Next: unlink, Previous: lseek, Up: List of Supported Calls [Contents][Index]
int rename(const char *oldpath, const char *newpath);
‘Frename,oldpathptr/len,newpathptr/len’
On success, zero is returned. On error, -1 is returned.
EISDIRnewpath is an existing directory, but oldpath is not a directory.
EEXISTnewpath is a non-empty directory.
EBUSYoldpath or newpath is a directory that is in use by some process.
EINVALAn attempt was made to make a directory a subdirectory of itself.
ENOTDIRA component used as a directory in oldpath or new path is not a directory. Or oldpath is a directory and newpath exists but is not a directory.
EFAULToldpathptr or newpathptr are invalid pointer values.
EACCESNo access to the file or the path of the file.
ENAMETOOLONGoldpath or newpath was too long.
ENOENTA directory component in oldpath or newpath does not exist.
EROFSThe file is on a read-only filesystem.
ENOSPCThe device containing the file has no room for the new directory entry.
EINTRThe call was interrupted by the user.