in reply to File list from gz file without reading everything into memory

The tar file format is quite simple, a 512 bytes header followed by the file contents also padded to a 512 boundary (see Tar_(file_format)).

As you only have one file per archive...

  1. open the file with the corresponding :gzip layer
  2. read the header and extract the file size from there
  3. read lines taking care to remove the extra nulls from the last line on the file