in reply to Re^2: rename zip files and folders inside zip files
in thread rename zip files and folders inside zip files
endRead() Must be called to close files, etc.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: rename zip files and folders inside zip files
by mariog (Acolyte) on Aug 31, 2015 at 10:19 UTC | |
it tells me: Can't locate object method "endRead" via package "Archive::Zip::Archive" at ./ziprenamer2.pl line 12. if I do this: I get the same error as before and too many files open and only about 1000 files are processed Note I just have to do it once.. the next times I only have to rename the last one arrived.. it will be set as a cron job. thank you. | [reply] [d/l] [select] |
by graff (Chancellor) on Sep 04, 2015 at 04:08 UTC | |
I used a subroutine for all the Archive::Zip activity, in the hope that the scoping would force each iteration to leave a clean slate (because the $zip object should be destroyed when it goes out of scope). But since I got "too many files open", it must be the case that the zip object is not getting cleaned up. I'd call this a bug, either in the module itself, or else in whatever zip library it links to. Better to use IO::Compress::Zip and IO::Uncompress:Unzip -- especially since these are "core" modules, part of the standard Perl distro. I tried the code below, it didn't fail, and it changed the name of each zip file and of the data file in each zip. (It assumes there's only one data file per zip.)
UPDATE: I should have mentioned: Archive::Zip on my (macosx) laptop hit "too many files open" after less than 300 files; I'm impressed that you were able to get as far as 1000. | [reply] [d/l] [select] |
|
Re^4: rename zip files and folders inside zip files
by mariog (Acolyte) on Aug 28, 2015 at 11:55 UTC | |
| [reply] |
by graff (Chancellor) on Aug 29, 2015 at 04:30 UTC | |
| [reply] |
by mariog (Acolyte) on Sep 01, 2015 at 09:00 UTC | |
it tells me: Can't locate object method "endRead" via package "Archive::Zip::Archive" at ./ziprenamer2.pl line 12. if I do this: I get the same error as before and too many files open and only about 1000 files are processed Note I just have to do it once.. the next times I only have to rename the last one arrived.. it will be set as a cron job. thank you. | [reply] [d/l] [select] |