Rename bug?

Nathan Glasser nathan at eddie.MIT.EDU
Tue May 24 09:46:14 AEST 1988


On my vax running 4.3bsd, apparently calling the rename(2) function
with the same filename for both arguments causes the function to
remove the file, and return 0 indicating success.

e.g. The program

main()
{
    rename("foo","foo");
}

will remove the file foo.


This is definitely contrary to the statement of the man page which
says that an instance of the file is guaranteed to exist, even
if the system crashes.
-- 
				Nathan Glasser
fnord				nathan@{mit-eddie.uucp, xx.lcs.mit.edu}
"A tribble is the only love that money can buy."	    
Presently there is insufficient evidence to conclude that tribbles spread AIDS.



More information about the Comp.unix.questions mailing list