-
Notifications
You must be signed in to change notification settings - Fork 0
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
Detect directory loops #17
Comments
We ended up detecting any kind of directory loop, not just those caused by symlinks. Should never happen without symlinks, the filesystem itself may be corrupted somehow (e.g. directory hardlinks). |
Not all errors mean files couldn't be compared. See e.g. israel-lugo/capidup#17 (detect directory loops).
We were detecting loops related to symlinks even when follow_dirlinks was false, i.e. when the symlinks would be irrelevant.
We still have false positives, when there is a (forward) symlink to a subdir. For example, given the following file tree:
we have the following output:
When in reality we should have output like this:
|
Mark the current directory as visited before inspecting the subdirs. This lets us catch symlinks to it immediately, instead of after entering one level of loop. See #17.
We still have false positives. This, for example:
Produces a false positive when we enter child2/brother, as we've already visited child1:
This isn't a loop. Compare e.g. with
Do we need to go and implement a graph and strongly connected components? :/ |
Now that
find_duplicates_in_firs
has thefollow_dirlinks
parameter (see #16), we need a way to detect symlink loops. If there is a symlink pointing to.
, or to a parent directory, we will go in a loop.Fortunately,
os.walk()
seems to stop after several levels of recursion. But still, it's probably undefined behavior.See what commands like
find
orrsync
do.The text was updated successfully, but these errors were encountered: