HP C/iX Library Reference Manual (30026-90004)

Chapter 5 293
HP C/iX Library Function Descriptions
rename
rename
Renames an existing file.
Syntax
#include <stdio.h>
int rename (const char *
oldname
, const char *
newname
);
Parameters
oldname
A pointer to a string containing the name of the existing file whose name is
to be changed. The string must be terminated by a null character.
newname
A pointer to a string containing the new name of the file. The string must
be terminated by a null character.
Return Values
0 The file is successfully renamed.
1 An error occurred. The file is not renamed.
Description
The rename function changes the file named by
oldname
so that it has the name
newname
.
NOTE
The rename function is not supported in the POSIX/iX library. If called,
rename() returns a -1 and sets errno to ENOSYS to indicate that rename() is
not supported.
See Also
remove(), ANSI C 4.9.4.2