2 # vim: fileencoding=utf-8
4 location_code = ARGV.shift || 'mmd'
5 location = Location.find_by_code(location_code)
7 puts "location not found."
14 name, summary, size, date, mime, origname, with_key, with_password = line.chomp.split(/\t/)
15 when 'mmdfile', 'mmdacc1', 'mmdacc2'
16 name, summary, size, date, origname = line.chomp.split(/\t/)
18 md = /\.(.+)\z/.match(name)
20 code = File.basename(name, '.' + extname)
25 code = 'file%04d' % code.to_i
27 code = 'mini%04d' % code.to_i
31 puts [ code, extname ].join(' ')
32 Arc.create(:code => code, :extname => extname, :location => location, :summary => summary, :origname => origname)