If the network round trip time is 1second and the time to delete the directory with 1000 files is 1 second when done on the local drive, then I want the delete on the network share to be 2 seconds not 2000 or 4000 seconds.
For scanning - you'll get the list of content in chunks. The size of a chunk depends on the size of the buffer you provide. For smaller folders it'll normally fit in a single request.
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?
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.