Function lrs::file::rename

Renames a file.

Syntax

fn rename<P, Q>(from: P, to: Q, replace: bool) -> Result<(), Errno>
    where Q: ToCString,
          P: ToCString,

Arguments

NameDescription
from

The path of the file to be renamed.

to

The new name of the file.

replace

Whether to is replaced if it already exists.

Remarks

If the paths are relative, they will be interpreted relative to the current working directory. Both paths must refer to the same mount point or the operation fails.

Kernel versions

If replace is false, the required kernel version is 3.15.

See also