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 _______________________________________________ Chicken-hackers mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-hackers
