- Jun
- 223
- 0
I was thinking about replacing GNUWin32 rm with del, but del /s behaves inconsistently; consider:
x> dir /b1 /s
x\ultimo <DIR>
x\zz <DIR>
x\zz\ultimo
: This one removes (expected) only the root ultimo directory but leaves any ultimo file (or directory) in every subdirectory in place
x> del /eklqxyz /s ultimo
x> dir /b1 /s
x\zz <DIR>
x\zz\ultimo
: This one removes (unexpectedly) every ultimo file (or directory) in any subdirectory
x> del /eklqxyz /s ultimo
x> dir /b1 /s
%
: This one removes both, any ultimo file (or directory) in any subdirectory and every root level ultimo directory (a path was specified which is not found in the base directory)
x> del /eklqxyz nonsense ultimo
In my opinion, either the first command should also delete EVERY ultimo file (or directory) - a change for the worse -, or the second command should LEAVE any ultimo file (or directory) below the current level untouched - the way to go.
x> dir /b1 /s
x\ultimo <DIR>
x\zz <DIR>
x\zz\ultimo
: This one removes (expected) only the root ultimo directory but leaves any ultimo file (or directory) in every subdirectory in place
x> del /eklqxyz /s ultimo
x> dir /b1 /s
x\zz <DIR>
x\zz\ultimo
: This one removes (unexpectedly) every ultimo file (or directory) in any subdirectory
x> del /eklqxyz /s ultimo
x> dir /b1 /s
%
: This one removes both, any ultimo file (or directory) in any subdirectory and every root level ultimo directory (a path was specified which is not found in the base directory)
x> del /eklqxyz nonsense ultimo
In my opinion, either the first command should also delete EVERY ultimo file (or directory) - a change for the worse -, or the second command should LEAVE any ultimo file (or directory) below the current level untouched - the way to go.