home ~ projects ~ socials

Copy A File To Another Location In Rust

use std::fs;

fn main() -> std::io::Result<()> {
    fs::copy("foo.txt", "bar.txt")?;  
    Ok(())
}
-- end of line --

References

The builtin function that the contents of one file to another