home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Unix System Administration Handbook 1997 October
/
usah_oct97.iso
/
news
/
cnews.tar
/
libfake
/
rename.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-09-08
|
281b
|
20 lines
/*
* fake ANSI C rename() function
*/
int
rename(old, new)
char *old;
char *new;
{
(void) unlink(new);
if (link(old, new) < 0)
return(1);
if (unlink(old) < 0) {
/* oops... could link but not unlink... try to recover */
(void) unlink(new);
return(1);
}
return(0);
}