in reply to Re: Is there an IO::*-like interface for accessing tar files?
in thread Is there an IO::*-like interface for accessing tar files?

Thank you for the feedback.

I was looking for something to read the contents of the file (a compressed archive of log files, for the curious). If possible, I was trying to retain the use of the close(), getline(), and input_line_number calls from the IO::* modules, so I could localize my dependent logic to one place.

I looked at the nextStream method you suggested, but it did not appear to do what I needed.

  • Comment on Re^2: Is there an IO::*-like interface for accessing tar files?

Replies are listed 'Best First'.
Re^3: Is there an IO::*-like interface for accessing tar files?
by MidLifeXis (Monsignor) on Feb 26, 2015 at 12:58 UTC

    Since a tar file contains an index, how would the getline() method behave? Would you anticipate being able to iterate through each file within the tar file and then use an IO:: object on each virtual file within that archive (where getline() would apply)?

    Just trying to clarify your expectations for my understanding.

    --MidLifeXis

      Yes, ideally a way to access (iterate through?) the contained files, and for a particular contained file a way to read line by line through that file.

        I wonder if you couldn't create a thin layer over Archive::Tar providing the IO::Dir interface for the TAR file itself, a method for opening the file name providing an IO::$something (IO::Handle perhaps) interface for a file handle created out of a scalarref from the Archive::Tar::File's get_content_by_ref method.

        Interested in this because I have a similar use case a couple of layers down on my todo list.

        --MidLifeXis