|
|
1.1 root 1: /*
2: * libc/stdio/rename.c
3: * ANSI-compliant C standard i/o library.
4: * ANSI 4.9.4.2.
5: * Rename a file.
6: * Implementation defined behavior:
7: * rename(old, new) fails and returns -1 if new exists.
8: */
9:
10: #include <stdio.h>
11:
12: int
13: rename(old, new) char *old, *new;
14: {
15: return (link(old, new) == -1 || unlink(old) == -1) ? -1 : 0;
16: }
17:
18: /* end of libc/stdio/rename.c */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.