dtrx-py / dtrx

Do The Right Extraction
GNU General Public License v3.0
230 stars 10 forks source link

Official list of supported file types #23

Closed an-schall closed 2 years ago

an-schall commented 2 years ago

Hi,

we are using dtrx as part of larger scripts to unroll / extract huge bulks of files. As part of the script dtrx receives input from 'find'. However, this leads to the situation that we call dtrx on files that are obviously no archives. Hence, I would like to create a filter to only call dtrx on file that have actual supported extensions.

Is there an official list of all the file types supported by dtrx? The readme list a bunch in the README but this list is not exhaustive.

Thanks

noahp commented 2 years ago

Hi @an-schall , thanks for filing this! I think it's something we can add- would a command-line flag to dump out the list make sense?

Something like:

$ dtrx --dump-extension-map
Z
bz2
bzip2
bzip2
compress
gz
gzip
gzip
lrz
lrz
lrzip
lz
lzma
lzma
lzma
tar.Z
tar.bz2
tar.gz
tar.lrz
tar.lz
tar.lzma
tar.xz
tar.zst
taz
tb2
tbz
tbz2
tgz
tlz
txz
xz
xz
xz
zstd

Note that dtrx also maps by mime-type and using the output of the file command, but I think extension matching is what would be the most useful to you?

noahp commented 2 years ago

Oh also note that dtrx relies on the matching decompression application for the actual decompression (eg you'd need to have tar, etc), so the list would indicate which extensions dtrx supports but might not match what the current system can decompress.

an-schall commented 2 years ago

Hi,

indeed extension matching is what we are looking for. Also your last point is rather valid: We experienced that dtrx does allow for decompressing jar files, while this is not explicitly listed. Would there be a straight-forward war to get a comprehensive list of all the file types covered even including those supported by the 3rd party applications?

Cheers

noahp commented 2 years ago

I think we could provide a list of:

Let me take a crack at this, I'll post here when I have something.

noahp commented 2 years ago

@an-schall FYI I've added this feature in the 8.3.0 release (published on GitHub and PyPi), definitely raise an issue if it's not working the way you need!

an-schall commented 2 years ago

Awesome, thanks a lot!