From: Thomas Sondergaard Date: 2005-09-06T17:51:27+09:00 Subject: Re: ZIP: Writing binary file fails Dmytro Bablinyuk wrote: > Hi, > > Ruby version 1.8.2 (windows XP) > RubyZip version 0.5.11 > > 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? You are using backslashes in the zip-file, which you shouldn't do, but I doubt that is the cause of the problem. Other than that your code works fine on my linux box. I'll try it in windows when I get home. I suspect it is a bug in rubyzip. Thomas