bugfindutils - Bugs: bug #48683, possible regression: "no such...

 
 

bug #48683: possible regression: "no such file or directory" error when directory is removed during execution

Submitter:  None
Submitted:  Tue 02 Aug 2016 10:07:42 PM UTC
   
 
Category:  find Severity:  3 - Normal
Item Group:  None Status:  Wont Fix
Privacy:  Public Assigned to:  jay
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.6.0
Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 27 Nov 2016 05:12:29 PM UTC, comment #2: 

Marking this as "Won't Fix" but I really mean, essentially, "Working as Intended".

James Youngman <jay>
Group administrator
Sun 27 Nov 2016 05:11:15 PM UTC, comment #1: 

If you are deleting things from the tree you are searching, use -depth so that find doesn't attempt to visit file system nodes that have been deleted.   If you can also use -delete to delete the things you want to delete, you are even less likely to see unexpected behaviour.

James Youngman <jay>
Group administrator
Tue 02 Aug 2016 10:07:42 PM UTC, original submission:  

I am running versions from the Debian sid repositories.

$ apt show findutils
Package: findutils
Version: 4.6.0+git+20160703-2

$ find --version
find (GNU findutils) 4.7.0-git

I was attempting to clean multiple project directories with the same command, effectively `rm -r` triggered by the presence of a certain file.

The `find` command will print a "no such file or directory" error when a directory is removed while the command is running. Repro:

$ ls
$ mkdir -p a/b/c
$ touch a/b/test
$ ls -R
.:
a

./a:
b

./a/b:
c  test

./a/b/c:

$ find . -type f -name test -execdir rm -r c \;
find: ā€˜./a/b/cā€™: No such file or directory

$ echo $?
1

$ ls -R
.:
a

./a:
b

./a/b:
test

Expected behavior is identical results but no error, like in GNU find 4.4.2 on Ubuntu.

Moreover, this error persists even in the presence of `-prune`, which strikes me as unintuitive.

$ find . -type d -name c -prune -o -type f -name test -execdir rm -r c \;
find: ā€˜./a/b/cā€™: No such file or directory

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jay (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-27 jay StatusNone Wont Fix
        Assigned toNone jay
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code