rename

public func rename(String, String) -> Result[(), IoError]

Renames or moves from to to.

Wraps rename(2). Atomic within a single filesystem; cross- filesystem moves return EXDEV and require a copy + delete instead. If to exists, it is replaced (subject to type-match rules — file replaces file, directory replaces empty directory).

Errors

Returns Err(IoError) on any libc failure; errno is captured.

Defined in lang/std/os/fs.ks