From: Maciej Tomaka Date: 2008-08-07T20:49:19+09:00 Subject: Re: RubyZipFIleSystem - help with simple task Nathan Loyer wrote: > Maciej Tomaka wrote: >> Probably this archive does not contain the folder. >> Please try out: >> >> require 'rubygems' >> require 'zip/zipfilesystem' >> >> Zip::ZipFile.open("Evelyn Attwood.docx.zip") do |zipfile| >> puts zipfile.file.read('word/document.xml') >> end > > That works! Thank you. Can you explain why though? When I unzip the > archive, I see the folder. Is there a difference between a "directory" > and a folder in a zip file? There is no folder/directory difference - it is the same thing. But you may have it included in file or not. Example: $ zip document.zip document/sample.xml adding: document/sample.xml (stored 0%) $ unzip -l document.zip Archive: document.zip Length Date Time Name -------- ---- ---- ---- 0 08-07-08 13:39 document/ 0 08-07-08 13:39 document/sample.xml -------- ------- 0 2 files But if you create it using file-roller you don't have directory included: $ unzip -l document.zip Archive: document.zip Length Date Time Name -------- ---- ---- ---- 0 08-07-08 13:39 document/sample.xml -------- ------- 0 1 file Thats all. :) Best Regards Maciej -- Posted via http://www.ruby-forum.com/.