rename (Debugging with GDB)
Next: unlink, Previous: lseek, Up: List of Supported Calls [Contents][Index]
rename
- Synopsis:
int rename(const char *oldpath, const char *newpath);
- Request:
‘
Frename,oldpathptr/len,newpathptr/len’- Return value:
On success, zero is returned. On error, -1 is returned.
- Errors:
EISDIRnewpathis an existing directory, butoldpathis not a directory.EEXISTnewpathis a non-empty directory.EBUSYoldpathornewpathis 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
oldpathor new path is not a directory. Oroldpathis a directory andnewpathexists but is not a directory.EFAULToldpathptrornewpathptrare invalid pointer values.EACCESNo access to the file or the path of the file.
ENAMETOOLONGoldpathornewpathwas too long.ENOENTA directory component in
oldpathornewpathdoes 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.