How to properly recursively navigate into archives stored in archives

D

David Karr

I have a small perl script that I use to search archives for members matching a name. I'd like to enhance this so that if it finds any members in thearchive that are also archives (zip, jar, etc) it will then recursively scan those, looking for the original desired pattern.

I've looked through the "Archive::Zip" documentation, and I thought I saw how to do this. I noticed the "fh()" and "readFromFileHandle()" methods. However, in my testing, it appears that the "fh()" call on an archive memberreturns the file handle for the containing archive, not the member. Perhaps I'm doing it wrong, but I appreciate an example of how to do this.
 
D

David Karr

I have a small perl script that I use to search archives for members matching a name. I'd like to enhance this so that if it finds any members in the archive that are also archives (zip, jar, etc) it will then recursively scan those, looking for the original desired pattern.

I've looked through the "Archive::Zip" documentation, and I thought I sawhow to do this. I noticed the "fh()" and "readFromFileHandle()" methods. However, in my testing, it appears that the "fh()" call on an archive member returns the file handle for the containing archive, not the member. Perhaps I'm doing it wrong, but I appreciate an example of how to do this.

I got this answered, at: http://stackoverflow.com/questions/...-archivezip-to-recursively-walk-archive-files
 
J

J. Gleixner

I have a small perl script that I use to search archives for members matching a name. I'd like to enhance this so that if it finds any members in the archive that are also archives (zip, jar, etc) it will then recursively scan those, looking for the original desired pattern.

I've looked through the "Archive::Zip" documentation, and I thought I saw how to do this. I noticed the "fh()" and "readFromFileHandle()" methods. However, in my testing, it appears that the "fh()" call on an archive member returns the file handle for the containing archive, not the member. Perhaps I'm doing it wrong, but I appreciate an example of how to do this.

Keep looking at the documentation.. I haven't used it, but a quick
read and it looks like members(), and/or membersMatching() methods
seem to be what you're after.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top