Subject: Re: incompatible rename in crtdll
From: [email-masked] (Mumit Khan)

31 Oct 1998 12:45:40 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
To: Anders Norlander <[email-masked]>
Cc: [email-masked], [email-masked]

On Thu, 29 Oct 1998, Anders Norlander wrote:

> I have noticed that rename in crtdll does not behave as you would
> expect it to do on a unix system. If the new filename already
> exists the function will fail. I noticed this when porting
> patch to mingw32. Cygwin handles this correctly.
> To get around it you would have to do something like this:
> 
> #define rename(f,t) _ming_rename

This is a known bug in every MS runtime (acknowledged by everyone
but MS of course ;-)

This was a bug in a few of the older Unix systems as well, and my 
configure script still checks for this. If I see a buggy OS, *and*
if the OS runtime supports ``unlink'' (non-ANSI, but part of POSIX) 
in some form of the other, I unlink the <target> first. Unfortunately, 
this breaks rename()'s atomicity semantics, and by the same token 
any replacement we provide for mingw will be subtly broken as well.
(I was thinking of providing a modified rename() libmingw32.a at 
one point, but deccided against it because of this reason).

Regards,
Mumit

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".