brtotli command line tool: list option #258

Closed
opened 2026-01-29 20:40:57 +00:00 by claunia · 4 comments
Owner

Originally created by @stokito on GitHub (Oct 27, 2018).

gzip tool provides an option to list the archive contents:

l, --list        list compressed file contents

This is useful for archive managers like engrampa to let us known the uncompressed size.
For example if archiver doesn't support the list function then it needs for a workaround:
https://github.com/mate-desktop/engrampa/blob/master/src/fr-command-cfile.c#L158

Could you implement the similar option?

Originally created by @stokito on GitHub (Oct 27, 2018). gzip tool provides an option to list the archive contents: ``` l, --list list compressed file contents ``` This is useful for archive managers like engrampa to let us known the uncompressed size. For example if archiver doesn't support the list function then it needs for a workaround: https://github.com/mate-desktop/engrampa/blob/master/src/fr-command-cfile.c#L158 Could you implement the similar option?
claunia added the enhancement label 2026-01-29 20:40:57 +00:00
Author
Owner

@eustas commented on GitHub (Nov 1, 2018):

Surely, but a little bit later.

@eustas commented on GitHub (Nov 1, 2018): Surely, but a little bit later.
Author
Owner

@stokito commented on GitHub (Nov 1, 2018):

I tested gzip recently and it turned out few moments that might be interesting for you:

  1. --list returns original size, compress ratio in % and uncompressed_name which is in fact not and original file name but the same name of the archive just without .gz.
    This is very inconvenient because, for example, archive manager can't determine an original file name and it needs for parsing the gz file itself.
    I think this is a bug and I should send a letter to gzip team but anyway please don't do the same for brotli.

  2. --list --quiet do not returns headers. This simplifies a little bit parsing of the output by archive manager.

  3. To get an original modify time of the gziped file we need to call gzip --list --verbose because only with this option it shows date and time column:

method  crc     date  time           compressed        uncompressed  ratio uncompressed_name
defla cb048d2c Jul 17 17:17                1630                2030  21.0% file.txt

And the parsing of those two columns is not convenient: it shows date as "Jul 17" (no matter which locale on your system) and time in separate column. I think this is good that it doesn't localize time but just regular ISO datetime would be easier to parse. Another problem is that splitting columns just by space is not working anymore. The same problem for last column uncompressed_name: it can contain spaces and this makes a parsing trickier.

@stokito commented on GitHub (Nov 1, 2018): I tested gzip recently and it turned out few moments that might be interesting for you: 1. `--list` returns original size, compress ratio in % and `uncompressed_name` which is in fact **not** and original file name but the same name of the archive just without `.gz`. This is very inconvenient because, for example, archive manager can't determine an original file name and it needs for [parsing the gz file itself](https://github.com/mate-desktop/engrampa/blob/master/src/fr-command-cfile.c#L45). I think this is a bug and I should send a letter to gzip team but anyway please don't do the same for brotli. 2. `--list --quiet` do not returns headers. This simplifies a little bit parsing of the output by archive manager. 3. To get an original modify time of the gziped file we need to call gzip --list --verbose because only with this option it shows date and time column: ``` method crc date time compressed uncompressed ratio uncompressed_name defla cb048d2c Jul 17 17:17 1630 2030 21.0% file.txt ``` And the parsing of those two columns is not convenient: it shows date as "Jul 17" (no matter which locale on your system) and time in separate column. I think this is good that it doesn't localize time but just regular ISO datetime would be easier to parse. Another problem is that splitting columns just by space ` ` is not working anymore. The same problem for last column `uncompressed_name`: it can contain spaces and this makes a parsing trickier.
Author
Owner

@eustas commented on GitHub (Nov 1, 2018):

Brotli is a "stream" format, so it does not keep original filename & modification time (unlike gzip).
Future "brotli-framing-format" allows storing this metadata + other cool stuff.

@eustas commented on GitHub (Nov 1, 2018): Brotli is a "stream" format, so it does not keep original filename & modification time (unlike gzip). Future "brotli-framing-format" allows storing this metadata + other cool stuff.
Author
Owner

@eustas commented on GitHub (Jul 18, 2019):

Lets postpone until https://datatracker.ietf.org/doc/draft-vandevenne-shared-brotli-format/

@eustas commented on GitHub (Jul 18, 2019): Lets postpone until https://datatracker.ietf.org/doc/draft-vandevenne-shared-brotli-format/
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#258