mwoehlke <address@hidden> wrote:
...
Did you try with 5.97? I haven't tried 6.2 yet (will try to do that
No, since rm in that release is so different, and since
I don't plan to make a 5.98 release.
soon)... Um, actually, I am probably not going to try until someone can
tell me how the *&($ to test the exit code of 'make check' after I've
piped it through 'tee' :-) - tips would be most welcome!
Easiest test is on coreutils itself...
$ uname -srvmpio
Darwin 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005;
root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC Power Macintosh powerpc
RackMac3,1 Darwin
$ rm --version
rm (GNU coreutils) 5.97
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.
Written by Paul Rubin, David MacKenzie, Richard Stallman, and Jim Meyering.
$ ls coreutils-5.97
ls: coreutils-5.97: No such file or directory
$ tar xzf coreutils-5.97.tar.gz
$ find coreutils-5.97/ | wc -l
2788
$ rm -rf coreutils-5.97
rm: cannot remove directory `coreutils-5.97/m4': Directory not empty
rm: cannot remove directory `coreutils-5.97/lib': Di0rectory not empty
$ find coreutils-5.97/ | wc -l
173
$ rm -rf coreutils-5.97
$ find coreutils-5.97/ | wc -l
find: coreutils-5.97/: No such file or directory
0
$
Thanks. That's probably all I needed.
From those numbers and the number of files in lib and m4, I deduce
that your system's readdir is mistakenly returning NULL when there
are around 190 entries in a directory.
Would you please try this, to confirm the theory:
#!/bin/bash
for i in $(seq 150 200); do
echo i=$i
mkdir b; (cd b; mkdir $(seq $i) ); Rm -r b || { echo bug at i=$i; break; }
done
That should find the minimum number of entries for which rm fails.
Once you find that number, say 190, change the enum in your
copy of coreutils' src/remove.c that looks like this:
[snip]
CONSECUTIVE_READDIR_UNLINK_THRESHOLD = 189
Then recompile, and "rm -r" should work.