From: Thomas Sondergaard Date: 2005-09-07T04:36:28+09:00 Subject: Re: ZIP: Writing binary file fails Dmytro Bablinyuk wrote: > I am trying to zip a binary file. > For example > > Zip::ZipFile.open(target, Zip::ZipFile::CREATE) { |zipfile| > zipfile.dir.mkdir('bin') > zipfile.file.open('bin\eclipse.exe', 'w'){ |f| > f.write(File.open('bin\eclipse.exe', 'rb').read) > } > } > > This zips the file but file has only first 163 bytes written (original > file size ~100K) > > What I am doing wrong? Nothing. You found yet another bug in rubyzip - this time Windows specific, so I'm semi-excused :-). I have fixed it and put up rubyzip-0.5.12. gem install rubyzip or get it from http://rubyforge.org/projects/rubyzip. Thomas