Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: Top 10 reasons to start using ack

by petdance (Parson)
on Nov 30, 2006 at 05:37 UTC ( [id://586867] : note . print w/replies, xml ) Need Help??


in reply to Re^3: Top 10 reasons to start using ack
in thread Top 10 reasons to start using ack

I could see using "foo.gz" as the filename for a standalone file, using your streaming method.

For tarballs, though, I would have to extract to a temporary directory and delve through that, and that means write privileges that I don't want to assume.

xoxo,
Andy

  • Comment on Re^4: Top 10 reasons to start using ack

Replies are listed 'Best First'.
Re^5: Top 10 reasons to start using ack
by diotalevi (Canon) on Nov 30, 2006 at 05:39 UTC

    You can't extract a file at a time out to a temporary directory using File::Temp? Or even better - don't even write it back to disk.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

      Heck, your program doesn't even handle tarballs anyway! :-)

      The other thing is that this stops ack from being pure Perl and totally cross-platform.

      xoxo,
      Andy

        I don't think that's a reason to omit the feature, it just needs some care and maybe not everyone can use the feature. There's plenty of goodness available by reading from a "gunzip -c" stream and only slightly less by reading from Archive::Tar::Streamed. Sometime within the last month I wrote an iterator to read file by file from a tarball using that module but without any hoops to jump through. It's all easy.

        ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊