1989-05-30 13:34:25 +00:00
|
|
|
/*
|
|
|
|
* rename.c - rename a file
|
|
|
|
*/
|
1994-06-24 14:02:31 +00:00
|
|
|
/* $Id$ */
|
1989-05-30 13:34:25 +00:00
|
|
|
|
1990-09-11 10:26:42 +00:00
|
|
|
#if !defined(_POSIX_SOURCE)
|
1989-05-30 13:34:25 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
1990-01-22 11:13:26 +00:00
|
|
|
int _link(const char *name1, const char *name2);
|
1989-05-30 13:34:25 +00:00
|
|
|
|
|
|
|
int
|
|
|
|
rename(const char *old, const char *new) {
|
1990-01-22 11:13:26 +00:00
|
|
|
if (!_link(old, new))
|
1989-05-30 13:34:25 +00:00
|
|
|
return remove(old);
|
|
|
|
else return -1;
|
|
|
|
}
|
1990-09-11 10:26:42 +00:00
|
|
|
#endif
|