[Omake] Inconsistent rm behavior between Unix/Windows

Jason Hickey jyh at cs.caltech.edu
Mon Oct 27 13:11:39 PDT 2008


Actually, we're thinking of using the internal version even on Unix.
This would help make the behavior more consistent.

In this case, though, Win32 and Unix are just different...  However, I
agree with you.  "rm -f" should try everything possible to remove the
file, including changing the file's permission if necessary.

I've filed a ticket

   http://bugzilla.metaprl.org/show_bug.cgi?id=721

Jason

On Mon, Oct 27, 2008 at 12:46 PM, Andrew Gacek <andrew.gacek at gmail.com> wrote:
> 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
> _______________________________________________
> Omake mailing list
> Omake at metaprl.org
> https://lists.metaprl.org/mailman/listinfo/omake
>



-- 
Jason Hickey                  http://www.cs.caltech.edu/~jyh
Caltech Computer Science      Tel: 626-395-6568 FAX: 626-792-4257


More information about the Omake mailing list