chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATCH] Fix rename-file behavior on Windows when d


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] Fix rename-file behavior on Windows when destination exists
Date: Sun, 5 Oct 2014 20:31:58 +0200
User-agent: Mutt/1.4.2.3i

On Mon, Aug 18, 2014 at 04:34:23PM +0200, Michele La Monaca wrote:
> Hi,
> 
> (rename-file "x" "y")
> 
> fails on Windows if "y" already exists. I think it would be better to have the
> same behavior as Unix (i.e. overwrite). The attached patch does that.

Hi Michele,

Sorry for the late reply, I've only now gotten around to looking at
your patch.  Unfortunately, your patch doesn't work correctly when
the move fails: MoveFileEx does not set errno, so the strerror call
in library.scm will also not return the correct error message when
this happens.

Also, including windows.h from chicken.h seems a bit excessive.  Moving
it to runtime.c is probably a better place for it (it is already included
in that file).

I think for now the wisest is to keep the current behaviour as it is.
Perhaps for CHICKEN 5 someone(TM) can come up with a better way to
do generic error handling that doesn't fail so badly when trying to
use Windows-native functions.

Cheers,
Peter
-- 
http://www.more-magic.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]