On Wed, 4 Aug 2021 22:02:18 +0300 Lassi Kortela <la...@lassi.io> wrote:
>> Indeed, that does the trick on *nix, even though we won't be able to >> catch rmdir errors in case it fails on empty directories, but I think >> that's not too bad in this case. > > Agreed. It will just write an error message on stderr in that case. I think that's fine. Checking & deleting would be subject to race conditions, and that would be much worse IMO. Since we've managed to survive all these years without deleting those directories, I don't think it'll hurt to keep them in very exceptional cases. :-) >> Any idea how to do something equivalent on Windows? > > A web search shows that Windows also has an "rmdir" command and it > should work the same way as the Unix command for this purpose, but I > haven't tested it: > https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/rmdir Is `true' also available? I could not find it in the left pane of that page, and searching for `true' gave me a huge amount of unrelated results. https://stackoverflow.com/questions/22046780/whats-the-windows-command-shell-equivalent-of-bashs-true-command has some creative suggestions, but I haven't tested them (I don't have a Windows system around). All the best. Mario -- http://parenteses.org/mario