URL:
<http://savannah.gnu.org/bugs/?48683>
Summary: possible regression: "no such file or directory"
error when directory is removed during execution
Project: findutils
Submitted by: None
Submitted on: Tue 02 Aug 2016 10:07:42 PM UTC
Category: find
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 4.6.0
Fixed Release: None
_______________________________________________________
Details:
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
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?48683>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/