2009-02-18 22:43:22 +00:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
|
|
|
|
require File.join(File.dirname(__FILE__), '_common.rb')
|
|
|
|
|
|
|
|
require 'mongo/gridfs'
|
2009-08-20 14:50:48 +00:00
|
|
|
include GridFS
|
2009-02-18 22:43:22 +00:00
|
|
|
|
2009-08-20 22:48:09 +00:00
|
|
|
db = Connection.new(DEFAULT_HOST, DEFAULT_PORT).db(DEFAULT_DB)
|
2009-02-18 22:43:22 +00:00
|
|
|
|
|
|
|
input_file = ARGV[0]
|
|
|
|
output_file = ARGV[1]
|
|
|
|
|
|
|
|
File.open(output_file, "w") { |f|
|
|
|
|
GridStore.open(db, input_file, "r") { |g|
|
|
|
|
f.write(g.read)
|
|
|
|
}
|
|
|
|
}
|