Open System Services System Calls Reference Manual (G06.25+, H06.03+)
rename_oss(2) OSS System Calls Reference Manual
NAME
rename_oss - Renames a file or directory (OSS rename( ) function)
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: system library
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: implicit libraries
SYNOPSIS
#include <stdio.h>
int rename(
const char *from,
const char *to);
int rename_oss(
const char *from,
const char *to);
PARAMETERS
from Identifies the file or directory to be renamed.
to Identifies the new pathname of the file or directory to be renamed.
If the to parameter points to an existing file or an empty directory, that file or
directory is replaced by the contents of the object identified by the from parame-
ter. If the to parameter refers to a directory that is not empty, the function exits
with an error.
DESCRIPTION
The OSS rename() function and rename_oss() function rename a directory or a file within a
fileset.
These functions are identical in the OSS environment. (Refer to Interoperability Variants later
in this reference page.) Unless otherwise noted, this reference page uses rename() to refer to
both the OSS rename() function and rename_oss() function.
If the from and to parameters both refer to the same existing file, the function returns successfully
and performs no other action.
For the function to finish successfully, the calling process must have write and search (execute)
permission for the parent directories of the entities specified by the from and to parameters. If
both the from and to parameters refer to directories, write and search (execute) permission are not
required on the specified directories.
The entities specified by the from and to parameters both must be of the same type (that is, both
directories or both files) and must reside on the same fileset. If the entity pointed to by the to
parameter already exists, it is first removed. In that case it is guaranteed that a link specified by to
will exist throughout the operation. This link refers to the file specified by either the to or from
parameter before the operation began.
If the final component of the from parameter is a symbolic link, the symbolic link (not the file or
directory to which it points) is renamed. If the final component of the to parameter is a symbolic
link, the symbolic link is destroyed.
6−26 Hewlett-Packard Company 527186-003