Problems extracting files from a zip archive
Sarah Reichelt
sarah.reichelt at gmail.com
Sun May 27 19:07:43 EDT 2007
Hi All,
I've been experimenting with the revZip commands, mostly successfully.
However I have found that once a zip archive file has been edited
either by adding or deleting a file, I am unable to extract any files
from it, either to a file or to a variable,
Extracting to a file creates the file OK, but it is empty and then I
just get spodded and have to force-quit Rev. Extracting to a variable
gives a rather strange 'error': "ziperr,No error" and returns an empty
variable.
It works fine if I just create a new archive file either using the
standard OS X "Create Archive" or using the revZip commands, but if I
later add a file or delete a file, then the archive no longer allows
me to extract anything. Trying to open it in Finder gives the error
"Unable to unarchive "Archive.zip" into "Desktop". (Error 2 - No such
file or directory.)"
Oddly enough, I use exactly the same script to add files initially as
to add them later, so it works fine if the file is empty, but not if
the file already contains anything. I use "revZipAddItemWithFile" to
add files and "revZipDeleteItem" to delete files, opening & closing
the archive each time. Neither of these commands gives any error, but
they corrupt the archive. I can still use "revZipEnumerateItems" to
see what is in the archive.
One further clue is that whenever I add or delete items to or from an
existing archive file, the file size reduces to a ridiculous number.
e.g. i I have a 30K zip file and add 10 K file, the resulting zip
file drops to 1.6K. If I have the sme 30K file and delete a 1K file,
the size drops to 700 bytes.
Unless anyone has any suggestions, I'll bugzilla this one.
Cheers,
Sarah
More information about the use-livecode
mailing list