1 |
/* rename -- rename a file |
/* rename -- rename a file |
2 |
This function is in the public domain. */ |
This function is in the public domain. */ |
3 |
|
|
4 |
/* Rename a file. */ |
/* |
5 |
|
|
6 |
|
@deftypefn Supplemental int rename (const char *@var{old}, const char *@var{new}) |
7 |
|
|
8 |
|
Renames a file from @var{old} to @var{new}. If @var{new} already |
9 |
|
exists, it is removed. |
10 |
|
|
11 |
|
@end deftypefn |
12 |
|
|
13 |
|
*/ |
14 |
|
|
15 |
|
#include "ansidecl.h" |
16 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
17 |
#include "config.h" |
#include "config.h" |
18 |
#endif |
#endif |
23 |
|
|
24 |
int |
int |
25 |
rename (zfrom, zto) |
rename (zfrom, zto) |
26 |
char *zfrom; |
const char *zfrom; |
27 |
char *zto; |
const char *zto; |
28 |
{ |
{ |
29 |
if (link (zfrom, zto) < 0) |
if (link (zfrom, zto) < 0) |
30 |
{ |
{ |