[Top][All Lists]

[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: C
Subject: [bug #46305] Doing "find -L . -type d -delete" fails on symlinks to directories.
Date: Tue, 27 Oct 2015 01:23:13 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0


                 Summary: Doing "find -L . -type d -delete" fails on symlinks
to directories.
                 Project: findutils
            Submitted by: pfudd
            Submitted on: Tue 27 Oct 2015 01:23:12 AM GMT
                Category: find
                Severity: 3 - Normal
              Item Group: Wrong result
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.4.2
           Fixed Release: None



The '-L' option makes '-type d' detect symlinks to directories, but '-delete'
doesn't treat them as such.

$ mkdir /tmp/foo
$ cd /tmp/foo
$ mkdir baz
$ ln -s baz bar
$ find -L . -type d
$ find -L . -type d -delete
find: cannot delete `./bar': Not a directory
$ ls -l
total 0
lrwxrwxrwx 1 root root 3 Oct 26 18:12 bar -> baz

I'd expect --delete to delete whatever it found.

Note: if 'bar' is the directory and 'baz' is the symlink, then no error
message is generated, but baz remains as a broken symlink, since the directory
was deleted before the symlink was found (assuming sorted directory

Also, http://ftp.gnu.org/gnu/findutils/ indicates that 4.4.2 is the latest
version (from 2009), but this bug-reporting page indicates that 4.5.14 is the
latest version.  Please link to the new download page on
https://savannah.gnu.org/projects/findutils/, or expect bug reports about
ancient versions of the code.  :-)



Reply to this item at:


  Message sent via/by Savannah

reply via email to

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