in reply to Using Archive::Tar on tar data already in memory
If you open the variable containing the the decompressed tar data as a ramfile (Search for # in memory files in perlfunc (5.8.x)), you should be able to pass the resultant filehandle to Archive::Tar. Something like (untested):
... my $uncompressed = memBunzip( $compressed ); open my $ramFH, '<', \$uncompressed; my $tar = Archive::Tar->new; my @ATFobjects = $tar->read( $ramFH, 0, { extract => 1 } ); for my $ATFobject ( @ATFObjects ) { my $content = $ATFObject->getContent; ## Do something with the content. }
|
|---|