1

I am writing a small python script to zip a file on linux.

on the same machine after creating the zip , when i did an

unzip -l temp.zip

i am able to see the content but when i am moving the file to windows , on a double click i am not able to see any folder inside the zip .

However if i extract it , am able to see those files inside the folder .

files=['/home/myfile.txt']
restoreZip = zipfile.ZipFile("temp.zip", "w", zipfile.ZIP_DEFLATED)
for file in files:
        restoreZip.write(file)
restoreZip.close()

If i create the files using zip -r temp.zip /home/myfile.txt , I am able to see the directory structure on double click when i am moving to windows machine .

1
  • Have you found a solution for this ?
    – Yonoss
    May 14, 2021 at 17:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.