Replies: 3 comments 7 replies
-
@TonyB9000 @golaz I have summarized the behavior of |
Beta Was this translation helpful? Give feedback.
-
Other notes
|
Beta Was this translation helpful? Give feedback.
-
@TonyB9000 I automated the testing script described above -- see #348. @golaz Regarding behavior of https://docs.python.org/3/library/tarfile.html states:
This is the mechanism So, with that usage description + the added tests, I think we can say this is performing correctly now. |
Beta Was this translation helpful? Give feedback.
-
I created a script to test different cases involving links.
Expand for test script
Two pull requests are relevant:
follow_symlinks
introduced: Include symlinks #261follow_symlinks
modifying-source-directory error fixed: Fix symlink behavior #343Legend for the tables below:
First 3 output columns:
->
is present in thels -l
output, indicating a link->
is not present in thels -l
output, indicating not a linkLast output column:
cat
on the extracted output, indicating the contents of the file is accessibleUsing
follow_symlinks
, the ideal output row looks like: 🔗 🔗 ❌ ✅ (src unaffected, src unaffected, extraction is a copy, data is accessible).Post-343
Post-343, using
follow_symlinks
Post-343, not using
follow_symlinks
Notice that the symlink is still present in the extracted output (second-to-last column). The only reason the file contents are accessible (last column) is because I archived on the same machine (i.e., the file path is still accessible).
Post-261
Post-261, using
follow_symlinks
In the first two rows, we see that zstash_src was altered by
zstash create
: the file is no longer a symlink! This was fixed in the post-343 output.In the third row, we see that before #343, if we deleted a symlink's source before running
zstash create
, thenzstash create
would actually also end up deleting the symlink in the directory being archived as well (rather than keeping the broken link).The hard links were unaffected by #343.
Post-261, not using
follow_symlinks
There is no difference at all between the post-261 and post-343 output when we don't use
follow_symlinks
.Pre-261
Pre-261, not using
follow_symlinks
(because that option doesn't exist yet)There is no difference at all between the pre-261 and post-261 (and post-343) output when we don't use
follow_symlinks
.Summarize the current changes
So, from pre-261 to post-343 what changed?
When not using
follow_symlinks
, nothing changed.When using
follow_symlinks
:In summary, hard links aren't affected by
follow_symlinks
, and symlinks are left unaltered in the directory being archived but end up being actual copies in the extracted output (rather than links to some file that might not even be accessible). If the symlink's source is deleted beforezstash create
, the file doesn't get archived at all (not even a broken symlink).Beta Was this translation helpful? Give feedback.
All reactions