OS X and the Unremovable File (2013)
galvanist.com
galvanist.com
Not that it's wrong to alert users to the problem, but it's more important, and not difficult, to alert Apple that this bug exists and users care about it.
http://superuser.com/questions/282194/how-do-i-remove-a-file...
sudo rm -rf *
They'll learn the hard way to use double quotes around the directory name.So, I shared the directory I could reach, then browsed to the \\share.
It worked. :D
01:30 shephard:shephard shephard$ touch foo
01:30 shephard:shephard shephard$ ls -li
total 0
102600870 -rw-r--r-- 1 shephard 2000 0 Nov 20 01:30 foo
01:30 shephard:shephard shephard$ find . -inum 102600870 -exec rm {} \;
01:30 shephard:shephard shephard$ ls -li
But - it doesn't work in this situation of long symlink. Wild. shephard:~ root# ls -li $str1/$str2/$str3/$str4
total 8
102601971 lrwxr-xr-x 1 root wheel 3 Nov 20 01:37 L -> ftw
shephard:~ root# find $str1/$str2/$str3/$str4 -inum 102601971 -exec rm {} \;
rm: 1.../2.../3.../4..../L: No space left on device
shephard:~ root#But yes, doesn't help for filenames that are too long.
README: No such file or directory
When people emailed me asking about why they couldn't read the README file, I'd tell them:Just run "emacs README" and you'll be able to read it with no problem!
Nobody ever got back to me after that bit of advice, but I hope it taught some people to love Emacs.
But I doubt that HFS+ is to blame here. It sounds like it's just a bug in the filesystem code.
Different programs might have different limits which are irrespective of the file system itself (and the filesystem has usually a different limit for a single name - PATH_MAX is usually relevant for symlink lookups).
linux/limits.h defines it as 4k, which is longer, but you would be surprised that many tools often define their buffer sizes arbitrarily (with 256 being _quite_ too common).
Given that each fs might have different limits, it's kind of bad practice to assume some fixed length as the maximum path size (I don't know if linux actually enforces PATH_MATH in vfs as a ceiling for all fses anyway).
plo-pro:~ root# pwd
/var/root
plo-pro:~ root# str1=$(python -c "print '1' * 255")
plo-pro:~ root# str2=$(python -c "print '2' * 255")
plo-pro:~ root# str3=$(python -c "print '3' * 255")
plo-pro:~ root# str4=$(python -c "print '4' * 253")
plo-pro:~ root# mkdir -p $str1/$str2/$str3/$str4
plo-pro:~ root# ln -s ftw $str1/$str2/$str3/$str4/L
plo-pro:~ root# (cd $str1/$str2/$str3/$str4; unlink L)
unlink: L: No space left on device
(all the other obvious delete commands also fail) sh-3.2# pwd
/var/root
sh-3.2# ln -s ftw $str1/$str2/$str3/$str4/L
ln: 1.../2.../3.../4.../L: File name too longWhat is surprising is the asymmetry: you can create the symlink, but cannot remove it.
sh-3.2# ln -s ftw $str1/$str2/$str3/$str4/L
ln: 1.../2.../3.../4.../L: File name too long
sh-3.2# mount
/dev/disk1 on / (hfs, local, journaled)
...
Edit: see my comment above - you can indeed create a path too long; just not in one go. sh-3.2# pwd
/private/var/root/1.../2.../3.../4...
sh-3.2# ln -s /var/root/ftw L
sh-3.2# rm L
rm: L: No space left on device