rename library routine in Microsoft C 3.0

Guy Harris guy at sun.uucp
Fri Jan 17 05:37:20 AEST 1986


> Today I was bitten by a difference in interpretation of rename's arguments
> between my good old 4.2 BSD and the brand new (and otherwise GOOD!)
> Microsoft C compiler (3.0).  BSD takes the first arg as the old file name
> and renames it to the second arg; Microsoft's library does it the other way
> around!
> Could anyone (besides Jim Cottrell :-) argue who is wrong?

If Microsoft added it after 4.2BSD came out, they're totally wrong.
Otherwise, it's somewhat a matter of opinion, except that 4.2BSD has a bit
of de-facto standardness about it, so it's probably the preferable
definition.

> Lattice C (which used to be Microsoft C version 2.03) does it the BSD
> way, but I believe this function was added after the version that
> Microsoft sold was frozen.

Another vote in favor of the BSD version.

> What does system 5 do (if it has one of these routines)?

It doesn't have a "rename" routine.

> What does P1003 say about it?

"The P1003 Working Group supports the X3J11 definition of the function
'rename()' with the additional provision that directories can be renamed."
X3J11 does it the 4.2BSD way, which means Microsoft will have to change if
they're going to be compatible with the C standard.  (However, the P1003
draft says that it was agreed that "rename" will fail if the new file
exists, which is not 4.2BSD compatible.)

	Guy Harris



More information about the Comp.unix mailing list