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
The following code creates a dangling symlink and tries to create a tar archive that includes the symlink. This fails with an error Error: No such file or directory (os error 2) on my Linux box.
I assume this is because follow defaults to true. Coming from a long-time Unix tar user, this surprises me. If I set follow to false, it still fails: Error: File exists (os error 17). This is also surprising.
Dangling symlinks are often an error, but they are technically valid in Unix, and can be used as an evil trick to store data that's not immediately obvious. I can understand if you don't want to support this, however. I'd be willing to try my hand at creating a patch to support this, however, if that would be welcome. I had a look and it wasn't immediately obvious to me how to make this change, though, so I though I'd start by reporting the issue.
The text was updated successfully, but these errors were encountered:
larswirzenius
changed the title
append_dir_all fails on danling symlinksappend_dir_all fails on dangling symlinks
Dec 23, 2023
The following code creates a dangling symlink and tries to create a tar archive that includes the symlink. This fails with an error
Error: No such file or directory (os error 2)
on my Linux box.I assume this is because
follow
defaults to true. Coming from a long-time Unix tar user, this surprises me. If I setfollow
tofalse
, it still fails:Error: File exists (os error 17)
. This is also surprising.Dangling symlinks are often an error, but they are technically valid in Unix, and can be used as an evil trick to store data that's not immediately obvious. I can understand if you don't want to support this, however. I'd be willing to try my hand at creating a patch to support this, however, if that would be welcome. I had a look and it wasn't immediately obvious to me how to make this change, though, so I though I'd start by reporting the issue.
The text was updated successfully, but these errors were encountered: