How to properly recursively navigate into archives stored in archives

Discussion in 'Perl Misc' started by David Karr, Jun 1, 2012.

  1. David Karr

    David Karr Guest

    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.
    David Karr, Jun 1, 2012
    #1
    1. Advertising

  2. David Karr

    David Karr Guest

    On Friday, June 1, 2012 9:57:01 AM UTC-7, David Karr wrote:
    > 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
    David Karr, Jun 1, 2012
    #2
    1. Advertising

  3. David Karr

    J. Gleixner Guest

    Re: How to properly recursively navigate into archives stored inarchives

    On 06/01/12 11:57, David Karr wrote:
    > 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.
    J. Gleixner, Jun 1, 2012
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nickname
    Replies:
    5
    Views:
    6,249
    Marcin Grunwald
    Mar 18, 2005
  2. Lambuz
    Replies:
    0
    Views:
    710
    Lambuz
    Mar 18, 2009
  3. Alain.Feler
    Replies:
    3
    Views:
    115
    Ghislain Mary
    May 15, 2005
  4. Wrapster Aol
    Replies:
    0
    Views:
    107
    Wrapster Aol
    Oct 3, 2008
  5. Mathematisch
    Replies:
    8
    Views:
    115
Loading...

Share This Page