vxfs_nattr_rename - rename a named data stream.
cc -I /opt/VRTS/include -L /opt/VRTS/lib-l vxfsutil -ldl
int vxfs_nattr_rename(int sfd, char *old, char *new);
The vxfs_nattr_rename() function changes the name space entry of the file sfd from the link old to the link new. old and new are resolved relative to the vnode pointed to by sfd.Renaming a named data stream to have a prefix of $vxfs: fails with the EINVAL error. The $vxfs: prefix is reserved by Veritas.
If the link named by new exists, the link count of the file becomes zero when the file is removed and no process has the file open. The space occupied by the file is freed and the file is no longer accessible. If one or more processes have the file open when the last link is removed, the link is removed before vxfs_nattr_rename() returns, but the contents of the file are not removed until all references to the file are closed.
After successful completion, vxfs_nattr_rename() marks the st_ctime and st_mtime fields of the parent directory of each file for update.
The behavior of "" (null string) for named data stream interfaces is same as "." (dot). If a user specifies "" as the path name of a file, the string is treated as "." and the named data stream directory file descriptor is returned.
strings do not correspond to the current directory and parent directory,
as they do in POSIX UNIX standards.
This allows users to create files with these names.
users should use appropriate names for named data streams that
will not be confusing when read from the POSIX UNIX name space perspective.
vxfs_nattr_rename() returns zero on success. Otherwise, -1 is returned and errno is set to indicate an error.
EACCES A component of either path prefix did not have search permission. One of the directories containing old and new did not have write permissions. There was no write permission for a directory pointed to by old or new. EINVAL A named data stream to has a prefix of $vxfs:. The $vxfs: prefix is reserved by Veritas. EIO An I/O error occurred while making or updating a directory entry. ENOTSUP The file system disk layout version does not support named data streams. ENAMETOOLONG The length of old or new exceeds PATH_MAX. A path name component is longer than NAME_MAX while _POSIX_NO_TRUNC is in effect. ENOENT The link named by old does not exist. Either old or new points to an empty string. EROFS The requested operation is a write operation to a directory on a read-only file system. EXDEV The links named by old and new are on different file systems.
vxfs_nattr_link(3), vxfs_nattr_open(3), vxfs_nattr_unlink(3) vxfs_nattr_utimes(3)