Re: Zip on the fly problem

"Thomas den Braber" <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
Yes I am sure that second argument is false.
In the old version I only used one argument but changed the second to 0
hoping that solved the problem.

As Torsten was suggesting, I tested with:

  script | cat > file

And yes that also fails with Archive::Zip 1.30  and worked ok
with 1.26

  script > file  

Worked in both versions.

There is something wrong in the new Archive::Zip module
I send a message to the CPAN forum hope they pick it up.

Thank,

Thomas den Braber

-----Original Message-----
From: Ronald J Kimball <[email protected]>
To: Scott Gifford <[email protected]>
Cc: Thomas den Braber <[email protected]>, [email protected]
Date: Tue, 12 Jan 2010 23:06:49 -0500
Subject: Re: Zip on the fly problem

> On Tue, Jan 12, 2010 at 10:11:04PM -0500, Scott Gifford wrote:
> > On Tue, Jan 12, 2010 at 7:49 AM, Thomas den Braber <[email protected]>
> wrote:
> > [ ... ]
> > 
> > > The error is: 'IO error: seeking to rewrite local header : Invalid
> > > argument'
> > >
> > 
> > That error means that after writing something to the ZIP archive, it
> tried
> > to go backwards to put what it just wrote in the header, but found it
> > couldn't do that because it's output is going over the network and
> what's
> > already sent can't be changed.
> > 
> > A temporary file is certainly one fix, as people here have suggested.
>  The
> > fact that it used to work means that it must be possible to generate
> a ZIP
> > file without seeking around, so my advice would be to poke around in
> the
> > options and see if you find anything useful.
> 
> The second argument to writeToFileHandle is supposed to address that:
> 
> writeToFileHandle( $fileHandle [, $seekable] )
> 
>     Write a zip archive to a file handle. Return AZ_OK on success. The
>     optional second arg tells whether or not to try to seek backwards
> to
>     re-write headers.
> 
>     ...
> 
>     If you pass a file handle that is not seekable (like if you're
> writing
>     to a pipe or a socket), pass a false second argument:
> 
>     ...
> 
> Thomas, are you sure the actual code in question is passing a false
> value
> as the second argument?
> 
> Ronald
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.