[Bug 288277] find(3) -delete flag doesn't delete all found directories
Date: Fri, 18 Jul 2025 16:02:39 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288277
Ed Maste <emaste@freebsd.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |emaste@freebsd.org
Resolution|--- |Not A Bug
Status|New |Closed
--- Comment #2 from Ed Maste <emaste@freebsd.org> ---
find -delete fails if attempting to delete a non-empty directory:
$ mkdir -p test-directory
$ touch test-directory/test-file
$ find . -iname test-directory -print -delete
./test-directory
$ echo $?
0
$ ls -l test-directory/
total 1
-rw-r--r-- 1 emaste emaste 0 Jul 18 11:57 test-file
as explained in the man page:
The -delete primary will fail to delete a directory if
it is not empty. Following symlinks is incompatible with this
option.
--
You are receiving this mail because:
You are the assignee for the bug.