Skip to content Skip to sidebar Skip to footer

Create Symlink Inside A Zipfile In Memory Using Python

I am looking for a way to create a zipfile in memory and include a symlink inside the zipfile. So far I have found this link and try the following code: from zipfile import ZipInfo

Solution 1:

If you create a symlink in bundle1 that points to bundle/test.txt, the target would have to be located in bundle1/bundle/test.txt. Symlinks alre always relative to their own path (unless of course they start with a /)

So to make this work, you need to change the link destination to ../bundle/test.txt.

Post a Comment for "Create Symlink Inside A Zipfile In Memory Using Python"