Re: Add Files to Zip File
From: Anno Siegel (anno4000_at_lublin.zrz.tu-berlin.de)
Date: 12/22/03
- Next message: Padraig_at_Linux.ie: "Re: replacing two EOL chars by one"
- Previous message: Uri Guttman: "Re: perl golf"
- In reply to: Mike Flannigan: "Re: Add Files to Zip File"
- Next in thread: Mike Flannigan: "Re: Add Files to Zip File"
- Reply: Mike Flannigan: "Re: Add Files to Zip File"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 21 Dec 2003 23:21:57 GMT
Mike Flannigan <mikeflan@earthlink.net> wrote in comp.lang.perl.misc:
>
> Anno Siegel wrote:
[using Archive::Zip]
> The files I am trying to zip are like this: 3461.
> They have no extension. So I'm saying pass up any
> files that do have an extension (don't zip them).
>
> The script below works fine. Of course it doesn't
> append the files to the existing zip file that already
> contains zipped up files - it overwrites the file.
> Probably all I need to do now is unzip the existing
> file, and then add all the files back into the zip file.
There is no need for that. Archive::Zip has methods to create
an archive from a disk file, add members, and write the updated
archive to a new file. I'd recommend that. If everything has
worked out (see below), you can rename() the new file to the old
name, completing the update.
Note that the numeric file names you are using for member names are
created by the news server. They are only unique at one time in a
single news group. Once an article expires, the server is free to
re-use the number. If the server is allowed to update groups between
runs, sooner or later you are going to write a member to an archive
that already has that member. I don't know how Archive::Zip handles
that, but it's something to think of.
[code snipped]
Anno
- Next message: Padraig_at_Linux.ie: "Re: replacing two EOL chars by one"
- Previous message: Uri Guttman: "Re: perl golf"
- In reply to: Mike Flannigan: "Re: Add Files to Zip File"
- Next in thread: Mike Flannigan: "Re: Add Files to Zip File"
- Reply: Mike Flannigan: "Re: Add Files to Zip File"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]