◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back► ─────Run-Time Library─────────────────────────────────────────────────────── The rename function renames the file or directory specified by <oldname> to the name given by <newname>. The old name must be the path name of an existing file or directory. The new name must not be the name of an existing file or directory. The rename function can be used to move a file from one directory to another by giving a different path name in the <newname> argument. However, files cannot be moved from one device to another (for example, from drive A to drive B). Directories can only be renamed, not moved. Return Value The rename function returns 0 if it is successful. On error, it returns a nonzero value and sets errno to EACCES, ENOENT, or EXDEV. -♦-