4 ms·
so what's the situation like on el capitan ?
by r618 11y ago
so what's the situation like on el capitan ?
- ploxiln 11y agoNot to directly answer your question but, I'm using Yosemite 10.10.5 and it's easy enough to check: 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)
- deleted 11y ago[deleted]
- self_awareness 11y agoOn ElCapitan: 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 long
- newhouseb 11y agoYay, that's actually the right error. MAX_PATH in xnu (the OS X kernel) is 1024 so it's not unsurprising that things get weird when you have paths at least 1025 characters long as in his example.
- avz 11y ago> MAX_PATH in xnu (the OS X kernel) is 1024 so it's not unsurprising that things get weird when you have paths at least 1025 characters long as in his example. What is surprising is the asymmetry: you can create the symlink, but cannot remove it.
- 0x0 11y agoIf you make a directory tree "a/a/a/a/a/a/a" and then rename every directory to "aaaaaaa (x255)" starting on the inner directory... How does other OSes deal with this? Does every rename at a top level folder check the filenames recursively first?
- robinhouston 11y agoThat’s interesting. I’m on El Capitan too (10.11.1) and as root I can create the symlink but not remove it. Might you be using a different filesystem or something?
- mhandley 11y agoHow strange. I'm also on 10.11.1, and I get "file name too long": 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.
- robinhouston 11y agoAh, it looks as though it works in /tmp (where I first tried) though not in my home directory. Very odd…
- r618 11y agoare you sure you haven't somewhere typo or are you possibly on beta ? - on 10.11.1 (15B42) as per OP the link gets created
- mhandley 11y agoEl Capitan won't let you create the path in one go (it gives file name too long), but you can create it incrementally: 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