Apr-06-2024, 01:49 AM
I would like to look into a zipped file and make sure it does not contain a Folder and only contains files. I am using Ubuntu 22 if that matters.
Is there just a way to list all folders or 'directories' in a zip file?
Currently I just determine if there is a '/' in the strings generated from the code below - which would indicate to me that the zipped files are in a "folder" and not just a bunch of files. Is there a better way?
(or is this related to 'everything is a file' in Linux? )
Is there just a way to list all folders or 'directories' in a zip file?
Currently I just determine if there is a '/' in the strings generated from the code below - which would indicate to me that the zipped files are in a "folder" and not just a bunch of files. Is there a better way?
(or is this related to 'everything is a file' in Linux? )
b= ZipFile (FULL_PATH)
for name in b.namelist(): print (type(name),name) d=name.split('/') print (len(d), d[0])Thanks.