copy binary files to dir and zip

C

Chas Conquest

'src' dir contains 2 binary files (mp3s)

I want to copy the files from 'src' into a new dir and then zip it.

The copy into a new dir is fine, but

I can't seem to get the new dir in to the zip.


Any clues?
Thanks!


<----Code----->

require 'rubygems'
require 'zip/zipfilesystem'
require 'FileUtils'


stuff = FileUtils.cp_r 'src/.', 'order' #this copies the files
fine...

Zip::ZipFile.open('stuff.zip', Zip::ZipFile::CREATE) do |zip|
zip.file.open('stuff.zip', 'w') { |f1| f1 << 'order'}
end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top