[Omake] Inconsistent rm behavior between Unix/Windows
Andrew Gacek
andrew.gacek at gmail.com
Mon Oct 27 12:46:12 PDT 2008
The 'rm' command (in osh) behaves differently on Unix and Windows when
used on read-only files. In Unix, the osh rm command uses the built-in
Unix rm command and removes a file even if it is read-only. On
Windows, the osh rm command uses ocaml's Unix.unlink which returns an
error when trying to delete a read-only file. Using the -f option does
not change this behavior except that the error on Windows is no longer
displayed to the user.
Is this a bug?
Right now I am working around the issue on Windows by replacing
rm -rf foo
with
chmod -rf 200 foo && rm -rf foo
Which seems to work but has the side-effect that it displays an error
message if the directory foo does not exist.
Thanks,
Andrew
More information about the Omake
mailing list