Bug 31075 - `find -exec' emits spurious warnings
Summary: `find -exec' emits spurious warnings
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: findutils   
(Show other bugs)
Version: 6.2
Hardware: i386 Linux
Target Milestone: ---
Assignee: Crutcher Dunnavant
QA Contact: Aaron Brown
Depends On:
TreeView+ depends on / blocked
Reported: 2001-03-08 17:04 UTC by Dimitri Papadopoulos
Modified: 2007-04-18 16:32 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-03-28 10:20:33 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Dimitri Papadopoulos 2001-03-08 17:04:00 UTC

Try this:
	$ mkdir dummy
	$ ls -d dummy
	$ find . -name dummy -exec rmdir {} \;
	find: ./dummy: No such file or directory
	$ ls -d dummy
	ls: dummy: No such file or directory
The `find: ./dummy: No such file or directory' is wrong as far as I can
It seems that `find' runs some test after -exec, but it should be run


Comment 1 Crutcher Dunnavant 2001-03-14 17:53:59 UTC
Not a bug.

find scans the directory, sees dummy, and performs the test -exec rmdir {} \; on
it. The test deletes the file, and returns true. Find tries to touch the file
again, to pass it on the next test (there aren't any, but there could be.).

The file no longer exists, and find complains.

Comment 2 Dimitri Papadopoulos 2001-03-21 17:55:44 UTC
Well, all this explanation is fine except that the Unix 'find' utility
doesn't emit this spurious warning (Solaris, SGI, etc.).

Also this means that I cannot delete directories using find???

Finally I've searched for 'touch' in the find man page and there's no
such thing as 'touch'. Why do you say find "tries to touch the file


Comment 3 Dimitri Papadopoulos 2001-03-28 10:20:28 UTC

Sorry for sounding like a broken record but the more I think about
it,the more I am convinced this is a bug. This explanation is not
> Find tries to touch the file again, to pass it on the next
> test (there aren't any, but there could be.).

I understand this as "this is correct because this is the way it
is coded". This does not address this issues:
- Not only find emits a warning but it returns an error status.
- This behaviour is different from the behaviour of find on other
  Unix (at least Solaris, Irix, Tru64) systems and is a cause of
  incompatibilities when running scripts- crontabs script would
  not work here.
- How am I supposed to delete directories using find?

Comment 4 Crutcher Dunnavant 2001-03-29 16:26:14 UTC
find . -name dummy | xargs rmdir

Note You need to log in before you can comment on or make changes to this bug.