pub fn copy_file<P>(src: P, dst: P) -> Result<()> where
    P: AsRef<Path>, 
Expand description

Atomic Copy File!

This will copy the contents of one file to another, atomically.

It is similar to std::fs::copy, but uses atomic writes and syncs ownership in addition to permissions (on Unix).

See write_file for more details about atomicity.

Errors

This will bubble up any filesystem-related errors encountered along the way.