bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #46305] Doing "find -L . -type d -delete" fails on symlinks to dire


From: Bernhard Voelker
Subject: [bug #46305] Doing "find -L . -type d -delete" fails on symlinks to directories.
Date: Mon, 16 Jul 2018 16:46:59 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

Follow-up Comment #3, bug #46305 (project findutils):

With "-L bar -delete", find would have to delete 2 files:
a) the symlink target '../foo', and
b) the symlink itself 'bar/baz'.

I agree with James that trying to fix (or work around) this
would probably more ask for trouble than being of help.

>From 'man find':

  -L   ... Actions that can cause  symbolic  links  to  become
       broken while find is executing (for example -delete)
       can give rise to confusing behaviour.

Depending on where the symlink points to, deleting possibly
the opposite way up the tree sounds too dangerous IMO; consider:
  ln -s ../../../../../../..  kllr-slink
or the 'symlink-to-root' example James gave.

Finally, also rm(1) and rmdir(1) do not have an -L option - probably
for a good reason.

Have a nice day,
Berny

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46305>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]