Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.micro.pc,net.unix Subject: Re: rename library routine in Microsoft C 3.0 Message-ID: <3158@sun.uucp> Date: Thu, 16-Jan-86 14:37:20 EST Article-I.D.: sun.3158 Posted: Thu Jan 16 14:37:20 1986 Date-Received: Sat, 18-Jan-86 01:12:38 EST References: <6727@boring.UUCP> Organization: Sun Microsystems, Inc. Lines: 32 Xref: watmath net.micro.pc:6553 net.unix:6850 > 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