Sunflower icon indicating copy to clipboard operation
Sunflower copied to clipboard

Zip provider: directories in some zip files are not displayed

Open joshas opened this issue 4 years ago • 5 comments

In some very specific ZIP files, e.g. Android APKs (zip provider doesn't support them out of the box yet, but one can add .zip extension to apk and open it), directories are not stored as separate entries, but files have directory paths. That results only in files on top level to be displayed in file list, files in subdirectories are missing.

joshas avatar May 20 '20 18:05 joshas

Perhaps we should create new provider which inherits ZipProvider and just alter this behavior? Since there are similarities but I don't know if we should just add additional checks inside of ZipProvider.

MeanEYE avatar May 20 '20 20:05 MeanEYE

Maybe we should have a ZipProvider based on libarchive instead of Python zipfile. We would be able to handle tar, gz, and a lot more....

cmallwitz avatar May 20 '20 22:05 cmallwitz

Not a bad idea @cmallwitz. Does it come preinstalled? Does it have Python module?

MeanEYE avatar May 20 '20 22:05 MeanEYE

From Python perspective there is: https://pypi.org/project/libarchive/. The lib itself should be installed on all Gnome-based system as it is used for all archive support in Nautilus and GVFS https://wiki.gnome.org/Projects/gvfs (e.g. the Gnome Archive Mounter). After "mounting" an archive using GVFS, you can double click on files (in Nautilus) and the correct launcher starts up. Think about "mounting" an ISO archive and playing a movie straight out of it using a GVFS aware player (all the standard Gnome ones.)

cmallwitz avatar May 21 '20 08:05 cmallwitz

Hm, on my system Python module is not installed by default, but libarchive itself is. I'll have to take a detailed look before I add another dependency but if it indeed supports so many archives it's a nobrainer then.

MeanEYE avatar May 21 '20 21:05 MeanEYE