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

18 lines
267 B
C
Raw Normal View History

1989-05-30 13:34:25 +00:00
/*
* rename.c - rename a file
*/
/* $Header$ */
#if !defined(_POSIX_SOURCE)
1989-05-30 13:34:25 +00:00
#include <stdio.h>
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