Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Keep relative symbolic links relative #85

Closed
dennda opened this Issue · 0 comments

1 participant

@dennda

Currently, the library will resolve symbolic links that are relative into absolute paths, using the current working directory of the process that's doing the unzipping, which to me seems pretty wrong.

@dennda dennda referenced this issue from a commit in dennda/ssziparchive
@dennda dennda Issue #85: Keep relative symbolic links relative.
Before, the library resolved symbolic links that are relative
into absolute paths, using the current working directory of the process
that's doing the unzipping, which to me seems pretty wrong.
This was due to using -[NSURL fileURLWithPath:], which transforms
relative URLs to absolute URLs automatically.

I don't see much of a reason to use NSFileManager here, so I made that
use symlink() directly. Alternatively, one could also use -[NSURL
URLWithString:].

This keeps relative symlinks relative after unzipping.
a5de5b6
@dennda dennda referenced this issue from a commit in dennda/ssziparchive
@dennda dennda Issue #85: Add test for relative symlink preservation patch.
This test adds a fixture RelativeSymlinks.zip with the following
structure:

    RelativeSymbolicLink
    ├── symlinkedFile
    ├── symlinkedFolder
    └── symlinks
       ├── fileSymlink -> ../symlinkedFile
       └── folderSymlink -> ../symlinkedFolder

The test checks if both `fileSymlink` and `folderSymlink` still point to
the respective files in the parent directory after the fixture has been
unzipped.
f89c159
@dennda dennda closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.