All rights reserved.
%sccs.include.redist.man%
@(#)rename.2 6.6 (Berkeley) 06/23/90
rename(from, to) char *from, *to;
Rename guarantees that an instance of to will always exist, even if the system should crash in the middle of the operation.
If the final component of from is a symbolic link, the symbolic link is renamed, not the file or directory to which it points.
15 [EINVAL] Either pathname contains a character with the high-order bit set.
15 [ENAMETOOLONG] A component of either pathname exceeded 255 characters, or the entire length of either path name exceeded 1023 characters.
15 [ENOENT] A component of the from path does not exist, or a path prefix of to does not exist.
15 [EACCES] A component of either path prefix denies search permission.
15 [EACCES] The requested link requires writing in a directory with a mode that denies write permission.
15 [EPERM] The directory containing from is marked sticky, and neither the containing directory nor from are owned by the effective user ID.
15 [EPERM] The to file exists, the directory containing to is marked sticky, and neither the containing directory nor to are owned by the effective user ID.
15 [ELOOP] Too many symbolic links were encountered in translating either pathname.
15 [ENOTDIR] A component of either path prefix is not a directory.
15 [ENOTDIR] From is a directory, but to is not a directory.
15 [EISDIR] To is a directory, but from is not a directory.
15 [EXDEV] The link named by to and the file named by from are on different logical devices (file systems). Note that this error code will not be returned if the implementation permits cross-device links.
15 [ENOSPC] The directory in which the entry for the new name is being placed cannot be extended because there is no space left on the file system containing the directory.
15 [EDQUOT] The directory in which the entry for the new name is being placed cannot be extended because the user's quota of disk blocks on the file system containing the directory has been exhausted.
15 [EIO] An I/O error occurred while making or updating a directory entry.
15 [EROFS] The requested link requires writing in a directory on a read-only file system.
15 [EFAULT] Path points outside the process's allocated address space.
15 [EINVAL] From is a parent directory of to , or an attempt is made to rename ``.'' or ``..''.
15 [ENOTEMPTY] To is a directory and is not empty.