Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix treatment of symlinks in interactive mode #27

Merged
3 commits merged into from
Jul 26, 2019
Merged

Conversation

vks
Copy link
Contributor

@vks vks commented Jul 25, 2019

Make sure to use symlink_metadata instead of metadata. This makes sure that symlinks are not followed when recursively deleting directories or when calculating file sizes.

The non-interactive mode is unaffected, because jwalk does not provide options to deal with symlinks.

vks added 3 commits July 25, 2019 13:16
The fix in 560a76d did not work, because it
checked the metadata of the file the symlink was pointing to, instead of the
metadata of the symlink. Effectively, this resulted in symlinks never being
detected.

Also see
https://doc.rust-lang.org/std/fs/struct.FileType.html#method.is_symlink.

Fixes Byron#24.
This should provide more accurate results. Unfortunately, this cannot be easily
fixed for the non-interactive part of the app, because it uses `jwalk` which
does not expose any options to deal with symlinks.
@vks vks mentioned this pull request Jul 25, 2019
@ghost ghost merged commit f205cec into Byron:master Jul 26, 2019
@ghost
Copy link

ghost commented Jul 26, 2019

Thanks so much! This is a big one, despite the small changes. It puzzles me how I could not find this in the documentation, it's quite obvious actually.

I will cut a new release right away!

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant