# Problems with Rubyzip

**URL:** <https://www.ruby-forum.com/t/problems-with-rubyzip/107462>\
**Category:** Ruby\
**Created:** [June 21, 2007, 11:40pm UTC](https://www.ruby-forum.com/t/problems-with-rubyzip/107462 "2007-06-21T23:40:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![billbell52](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ce73a5/32.png) [@billbell52](https://www.ruby-forum.com/u/billbell52)\
**Post date:** [June 21, 2007, 11:40pm UTC](https://www.ruby-forum.com/t/problems-with-rubyzip/107462/1 "2007-06-21T23:40:52Z")

</div>

I am having a problem with Rubyzip when I try to archive numerous  
large files. It runs fine for 63 files. The zip is about 250Meg when  
it fails. If I skip the file that fails then the next file fails. I  
am waiting on IT to install rubyzip on Linux and I will try it there.  
I tried it on another archive and it fails about 500Meg. When it  
fails if I check the zip (zip -T) it is a good zip file. The file it  
fails on does get in there. It appears to failing at the end of the  
commit. If I run it again it fails in exactly the same spot so it is  
not a network error.

Any ideas on what may be causing this?

Setup  
Running on PC over Samba.  
rubyzip 0.9.1 (latest version)

zipFile = Zip::ZipFile.open(curZipFile, true)  
addToZip(zipFile, toFile, stageFile)

def addToZip(zipFile, toFile, stageFile)  
begin  
zipFile.add(toFile, stageFile)  
@logFile.write(“zip #{stageFile} to #{toFile}\n”)  
zipFile.commit  
k = 1  
rescue SystemCallError  
$stderr.print "IO failed: " + $!  
@logFile.write("IO failed: " + $!)  
@logFile.close  
raise  
end  
end

\*\*\*This is my error from the rescue section  
IO failed: Invalid argument - s:/links/apex\_arch/  
F741566A\_d741566af1sf18/F741566A\_d741566af1sf18\_01.zip.2984.1

c:/ruby185/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:974:in  
`write’: Invalid argument - s:/links/apex\_arch/F741566A\_d741566af1sf18/  
F741566A\_d741566af1sf18\_01.zip.2984.1 (Errno::EINVAL)

```
    from c:/ruby185/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/

```

zip.rb:974:  
in `<<' from c:/ruby185/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/ zip.rb:974: in`copy\_raw\_entry’  
from c:/ruby185/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/  
zip.rb:808:  
in `write_to_zip_output_stream' from c:/ruby185/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/ zip.rb:1482 :in`commit’  
from c:/ruby185/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/  
zip.rb:1123  
:in `each' from c:/ruby185/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/ zip.rb:1123 :in`each’  
from c:/ruby185/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/  
zip.rb:1482  
:in `commit' from c:/ruby185/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/ zip.rb:937: in`open’  
from c:/ruby185/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/  
zip.rb:1479  
:in `commit’  
from c:/ruby185/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/  
zip.rb:1568
