coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

rm is unable to delete deep directory structure

Open arekm opened this issue 10 months ago • 3 comments

$ ~/.cargo/bin/coreutils
coreutils 0.0.29 (multi-call binary)
$ (for i in `seq 1 2000`; do mkdir 1234567890123456789012345678901234567890; cd 1234567890123456789012345678901234567890; done)
$ ~/.cargo/bin/coreutils rm -rf 1234567890123456789012345678901234567890
rm: cannot remove '1234567890123456789012345678901234567890': Too many open files (os error 24)

I'm not sure if this is the same problem - #5714 ?

(for comparison - gnu coreutils deals with this just fine:

$ /bin/rm -rf 1234567890123456789012345678901234567890
$ ls -ld 1234567890123456789012345678901234567890
ls: cannot access '1234567890123456789012345678901234567890': No such file or directory

)

arekm avatar Mar 02 '25 10:03 arekm

Related to https://github.com/uutils/coreutils/issues/7324

jfinkels avatar Mar 05 '25 22:03 jfinkels

$ (for i in seq 1 2000; do mkdir 1234567890123456789012345678901234567890; cd 1234567890123456789012345678901234567890; done)

This test is giving me the following error:

mkdir: cannot create directory '1234567890123456789012345678901234567890': File name too long

@arekm Which filesystem are you using? (Mine is ext4; also, I was trying it out in Docker).

nandedamana avatar Mar 13 '25 14:03 nandedamana

qemu vm, kernel 6.13.0 in guest, xfs and limit was

$ ulimit -n
1024

arekm avatar Mar 13 '25 23:03 arekm