Open System Services System Calls Reference Manual (G06.25+, H06.03+)

rename_oss(2) OSS System Calls Reference Manual
NAME
rename_oss - Renames a le 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 Identies the le or directory to be renamed.
to Identies the new pathname of the le or directory to be renamed.
If the to parameter points to an existing le or an empty directory, that le or
directory is replaced by the contents of the object identied 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 le within a
leset.
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 le, the function returns successfully
and performs no other action.
For the function to nish successfully, the calling process must have write and search (execute)
permission for the parent directories of the entities specied 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 specied directories.
The entities specied by the from and to parameters both must be of the same type (that is, both
directories or both les) and must reside on the same leset. If the entity pointed to by the to
parameter already exists, it is rst removed. In that case it is guaranteed that a link specied by to
will exist throughout the operation. This link refers to the le specied by either the to or from
parameter before the operation began.
If the nal component of the from parameter is a symbolic link, the symbolic link (not the le or
directory to which it points) is renamed. If the nal component of the to parameter is a symbolic
link, the symbolic link is destroyed.
626 Hewlett-Packard Company 527186-003