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

 
 

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

Submitted by:  None
Submitted on:  Tue 02 Aug 2016 10:07:42 PM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: NoneStatus: Wont Fix
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: 4.6.0
Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 27 Nov 2016 05:12:29 PM UTCjayStatusNone=>Wont Fix
      Assigned toNone=>jay
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1