Function std::old_io::fs::renameUnstable
[-] [+]
[src]
pub fn rename(from: &Path, to: &Path) -> IoResult<()>
Rename a file or directory to a new name.
Example
fn main() { #![allow(unused_must_use)] use std::old_io::fs; fs::rename(&Path::new("foo"), &Path::new("bar")); }use std::old_io::fs; fs::rename(&Path::new("foo"), &Path::new("bar"));
Error
This function will return an error if the provided from
doesn't exist, if
the process lacks permissions to view the contents, or if some other
intermittent I/O error occurs.