ack/lang/cem/libcc.ansi/stdio/rename.c

19 lines
275 B
C
Raw Normal View History

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
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
1989-05-30 13:34:25 +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) {
if (!_link(old, new))
1989-05-30 13:34:25 +00:00
return remove(old);
else return -1;
}
#endif