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
Currently fs_extra::remove_items does not act on symlinks that point to not-existing targets. It is not clear from the documentation what the intended behavior is, so I am not sure if this asks for fixing, or just documenting.
Reproduce
Assume a directory that contains symlinks, both to existing and non-existing targets:
Currently
fs_extra::remove_items
does not act on symlinks that point to not-existing targets. It is not clear from the documentation what the intended behavior is, so I am not sure if this asks for fixing, or just documenting.Reproduce
Assume a directory that contains symlinks, both to existing and non-existing targets:
A minimal rust program for reproduction:
And then:
(above tested on MacOS and Linux)
Expected
Up to the maintainers of the library:
link-1
andlink-2
are both removed.file-1
stays (unchanged).remove_items
has caveat (or maybe more broadly: recommend not to use with symlinks?)I think (1) makes the most sense. Alas this was my expectation when using
remove_items
.Causal
remove_items
usesfile::remove
, in case the item is not a directoryfile::remove
only removes when the path existsstd::path::Path::exists
, that evaluates the symlink target (which here is missing) and not the symlink itselfThe text was updated successfully, but these errors were encountered: