Re:Byenow – A command-line Windows utility for faster folder...
by jjnoakes on Thursday February 20, 2020 @10:52AM
(#22375894)
unlink(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.
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?