3 ms·
Why would that behave any differently than just calling rm directly? find isn't somehow invoking rm with the inode, it's just passing the path to rm.
by eridius 11y ago
Why would that behave any differently than just calling rm directly? find isn't somehow invoking rm with the inode, it's just passing the path to rm.
- the_mitsuhiko 11y agoIt would not. The way to unlink files is by path and not by inode. I don't think you can actually delete by inode on OSX.
- JupiterMoon 11y agoJust guessing but maybe the shell is eating the filename rather than rm eating it?
- eridius 11y agoThe article demonstrated trying to make the syscall directly and still receiving the error, which rules out any shell shenanigans.
- JupiterMoon 11y agoMy bad. I should rta.
- ghshephard 11y agoThis is useful when the file name gives the shell coniptions, such as when you are trying to remove a file named * or \ or $ or - . Anytime I see a file like that, I don't even try and figure out how to convince the shell/rm to properly escape the characters, I just switch back to the inode approach. But yes, doesn't help for filenames that are too long.