You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably the most cross-platform way, but on platforms where symlinks are known to work, there should be a version of unpack that just creates the correct symlinks.
Note that tar currently also cannot extract archives with broken symlinks (because it cannot copy something that doesn't exist). This new version unpack' :: Exception e => Bool -> FilePath -> Entries e -> IO () would not suffer from this problem either.
I tend to avoid providing an API with both foo and foo', which are almost identical, but not quite the same. This will be a constant source of users' confusion.
Is there a reason to stick to a current behaviour of unpack (except for compatibility with ancient directory)? Could we create symlinks by default?
Well, I don't know if all windows versions have this. The directory documentation reads like not all do and that it's filesystem dependent (even worse) and may require administrator privileges. So I don't think this is generally safe.
I tend to avoid providing an API with both foo and foo', which are almost identical, but not quite the same. This will be a constant source of users' confusion.
I disagree, because I prefer to not break existing API, especially when adding experimental features. The naming can be improved.
Activity
Bodigrim commentedon Apr 2, 2021
I tend to avoid providing an API with both
fooandfoo', which are almost identical, but not quite the same. This will be a constant source of users' confusion.Is there a reason to stick to a current behaviour of
unpack(except for compatibility with ancientdirectory)? Could we create symlinks by default?hasufell commentedon Apr 2, 2021
Well, I don't know if all windows versions have this. The directory documentation reads like not all do and that it's filesystem dependent (even worse) and may require administrator privileges. So I don't think this is generally safe.
I disagree, because I prefer to not break existing API, especially when adding experimental features. The naming can be improved.
hasufell commentedon Apr 2, 2021
The only question mark here is really windows, I see the following solutions:
unpack': breaks no API, can be marked experimentalunpackto toggle symlink behavior: will break existing API, but avoid a separate function... I'm not a fanWe can maybe have a look how other cross-platform tar implementations handle this?
hasufell commentedon Apr 2, 2021
python seems to go with the fallback option:
https://github.com/python/cpython/blob/9350cc02f862dd93aaaf78feb69fb0a102d3099c/Lib/tarfile.py#L2232-L2256
hasufell commentedon Apr 3, 2021
rust seems to just fail: https://github.com/alexcrichton/tar-rs/blob/f07b3c15e398a76a627e77b49952d44c5d5880d8/src/entry.rs#L495-L528
Create symlinks instead of always copying during unpack
hasufell commentedon Apr 4, 2021
Implemented in my existing PR:
Create symlinks instead of always copying during unpack
Create symlinks instead of always copying during unpack
Create symlinks instead of always copying during unpack
Create symlinks instead of always copying during unpack
Create symlinks instead of always copying during unpack
Create symlinks instead of always copying during unpack
Create symlinks instead of always copying during unpack
Create symlinks instead of always copying during unpack
Create symlinks instead of always copying during unpack
Create symlinks instead of always copying during unpack
Create symlinks instead of always copying during unpack
Create symlinks instead of always copying during unpack