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

18 lines
263 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
#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