[Overview][Constants][Types][Procedures and functions][Variables][Index] | Reference for unit 'oldlinux' (#rtl)

# FReName

Rename file

## Declaration

Source position: line 0

`function FReName(`
`OldName: Pchar;`
`NewName: Pchar`
`):Boolean; function FReName(`
`OldName: string;`
`NewName: string`
`):Boolean;`

## Description

FRename renames the file OldName to NewName. NewName can be in a different directory than OldName, but it cannot be on another partition (device). Any existing file on the new location will be replaced.

If the operation fails, then the OldName file will be preserved.

The function returns True on succes, False on failure.

## Errors

On error, errors are reported in LinuxError. Possible errors include:

sys_eisdir
  NewName exists and is a directory, but OldName is not a directory.
sys_exdev
  NewName and OldName are on different devices.
sys_enotempty or sys_eexist
  NewName is an existing, non-empty directory.
sys_ebusy
  OldName or NewName is a directory and is in use by another process.
sys_einval
  NewName is part of OldName.
sys_emlink
  OldPath or NewPath already have tha maximum amount of links pointing to them.
sys_enotdir
  part of OldName or NewName is not directory.
sys_efault
  For the pchar case: One of the pointers points to an invalid address.
sys_eaccess
  access is denied when attempting to move the file.
sys_enametoolong
  Either OldName or NewName is too long.
sys_enoent
  a directory component in OldName or NewName didn't exist.
sys_enomem
  not enough kernel memory.
sys_erofs
  NewName or OldName is on a read-only file system.
sys_eloop
  too many symbolic links were encountered trying to expand OldName or NewName
sys_enospc
  the filesystem has no room for the new directory entry.

## See also

UnLink |  | Unlink (i.e. remove) a file.

Documentation generated on: Feb 26 2014