loituma has asked for the wisdom of the Perl Monks concerning the following question:
Is there a way to list the files of a tar archive, but only those of depth 1 ? (sort of equivalent to "find --maxdepth=1")
I am using
my @list_files = $tar->list_files;
and then I would have to parse @list_files to find the one that interest me.
Which is stupid, because $tar contains only one directory, which contains the file I want plus many (many) other. So if i could get directly the name the directory, it would be much faster. Is there a faster/simpler way to do that?
Many thxs!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: listing files in tar archive, with depth 1
by ambrus (Abbot) on Jun 23, 2011 at 19:30 UTC | |
by loituma (Initiate) on Jun 23, 2011 at 19:49 UTC |