ack/lang/cem/libcc.ansi/stdio/rename.c
1989-05-30 13:34:25 +00:00

17 lines
260 B
C

/*
* rename.c - rename a file
*/
/* $Header$ */
#include <stdio.h>
int link(const char *name1, const char *name2);
int unlink(const char *path);
int
rename(const char *old, const char *new) {
if (!link(old, new))
return remove(old);
else return -1;
}