Skip to main content

replace

Function replace 

Source
pub fn replace(
    from: impl AsRef<Path>,
    from_fd: Option<Borrowed<'_>>,
    to: impl AsRef<Path>,
    to_fd: Option<Borrowed<'_>>,
) -> Result<()>
Expand description

https://docs.python.org/3/library/os.html#os.replace

Atomically replace to with from. POSIX’s rename already atomically replaces targets, so this function just forwards to rename.