This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: incompatible rename in crtdll


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
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]