libzip: libzip-discuss: Re: Bug in zip_close?

Thread

Thread Index

Message

From: "Pierre Joye" <pierre.php%gmail.com@localhost>
To: "Cary Fitzhugh" <CFitzhugh%echo360.com@localhost>
Subject: Re: Bug in zip_close?
Date: Tue, 15 Apr 2008 21:52:56 +0200

Hi Cary,

On Tue, Apr 15, 2008 at 9:35 PM, Cary Fitzhugh 
<CFitzhugh%echo360.com@localhost> wrote:

> If I create a zip file with 500 or so entries when I call zip_close it
> returns an error, but has used up all of my file handles on a WinXP box.  So
> in that particular process I can no longer open any new files.
>
>
>
> Any chance this is a bug in libzip – or is it just a FS limitation that I
> could get around by opening/closing the file a few times?

It is a FS limitation. Libzip design keeps all added file handles open
until you close the archive. It could be possible to get rid of this
problem by using native FS API on windows. Another solution would be
to do not process the files but at the close time. But it is then less
safe as a file may be removed between its addition and the close
operation.

I made some experiement with these two solutions for the PHP binding,
it worked well but it is not yet ready to be published (more a proof
of concept than a real clean patch :).

Cheers,
-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

Made by MHonArc.