Bill Allombert on Sun, 08 Sep 2024 14:14:05 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PATCH 2.16.2-beta] compressed input


On Thu, Aug 29, 2024 at 05:54:39PM -0700, Ilya Zakharevich wrote:
> This patch
>   • allows newer types of compression of input;
>   • protects against poison pills in the decompression command line.
> 
> Enjoy,
> Ilya
> 
> +typedef struct 
> +{
> +  char *ext;
> +  char *cmd;  
> +} decompress_tbl;
> +decompress_tbl decompress[] = {
> +#ifdef ZCAT
> +  {".Z",  ZCAT},
> +#ifdef GZCAT
> +  {".gz", ZCAT},
> +#endif	/* defined GZCAT */ 
> +#endif	/* defined ZCAT */ 
> +  {".bz2",  "bzip2 -dc"},
> +  {".xz",      "xz -dc"},
> +  {".zstd",  "zstd -dc"},
> +  {".7z",     "7za -so e"},
> +  {".zip",  "unzip -p"},
> +  {NULL, NULL}
> +};

You could also add lzma, lz and lzop.
Someone should really write a tool that provide consistent interface to all those.
PARI/GP is not the place to do it...

Cheers,
Bill.