[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Patch for transparent decompression
From: |
Tony Abou-Assaleh |
Subject: |
Re: Patch for transparent decompression |
Date: |
Sun, 27 Apr 2008 18:55:22 -0300 |
User-agent: |
Thunderbird 2.0.0.12 (Macintosh/20080213) |
Reuben Thomas wrote:
* In addition to documentation, I'd like to see some test cases. And
the more the better :O)
I'm not good at thinking of these; I'd be happy for any hints.
* Sample compressed file with a few common options passed to grep
* Pass through uncompressed file to test error handling
* Compile with the option disabled and test for error message
* Compile with the option enabled and test that it is in fact enabled
* A test with UTF-8 non-ASCII file name and file content would be good
as well.
* My understanding is that zlib support .gz files. Any plans to
integrate libbzip2 as well?
This is a nasty one. I see three options:
1. [Easiest for grep] Add code to grep to determine what sort of
compression we're looking at. Currently we don't have to do this.
2. [A bit cleaner, a bit slower] Write a little library that decides
whether to delegate to libbzip2 or libz for a given stream.
3. [Nicest solution, slowest and most difficult to get accepted] Patch
libz so that it can delegate to libbzip2 for bzipped files (or vice
versa), and just use the one interface.
I was thinking more of providing 2 options, so the user can tell grep
what kind of compression we use. But now that you mentioned it, we could
add a parameter to decompress: gz, bz2, auto. Depending on how easy/hard
auto is, we could start without auto and introduce auto later. We could
also default to gz for now, and later default to auto without causing
too much trouble.
Cheers,
TAA
--
Tony Abou-Assaleh
Email: address@hidden
Web site: http://tony.abou-assaleh.net