From: Bastien Helders on
Hi list,

I've got this web app, which from a list of selected folders (with content)
want to create a zip containing them as well as creating a text file with
information about the chosen folders and how to use them.

To create the zip file I use exec('zip -gr ' .$zipname.' * >> mylog.log');
in the temporary folder where I gathered all the data (using a zipArchive
object was more time consuming). I then create the text file using fopen,
many fwrites and a fclose.

My problem is the following, normally it creates the archive and text file
without any problem, but as soon as the number of selected folder has an
high value (let's say about 150 of them), I've got problems with the
generated files: The zip archive doesn't contain all the folders and there
is an unexpected end of file on both zip and text files.

My guess is, as it takes too much time, the script goes on to the next
operation and close the streams uncleanly. But I can't be sure about that,
and I don't know where to investigate.

Regards,
Bastien