3 ms·
(I'm just a hobbyist) Is that how .+n[i|u]x's unlink command works? IIRC you can unlink a directory. If that's true, how does MS's WSL handle unlink? Why doe
by pbhjpbhj 7y ago
(I'm just a hobbyist)
Is that how .+n[i|u]x's unlink command works? IIRC you can unlink a directory.
If that's true, how does MS's WSL handle unlink?
Why doesn't Windows del work like that, surely at the physical layer the drive is only removing allocation entries?
- jjnoakes 7y agounlink(2) returns EISDIR (on Linux at least) if you try to unlink a directory. I'm not sure if you can still do it, but long ago you could unlink(2) a directory as root, but it was not a good idea since it did not recursively free up the contents back to the file system's raw storage. To remove a directory on Linux you have to empty it out (recursively, using unlink(2) on files and rmdir(2) on empty directories) and then rmdir(2) the top level directory. So not a single system call.
- pbhjpbhj 7y agoThanks for humouring me, everyday a learning day - especially when there are kind people happy to share their knowledge ;o)