Function std::fs::metadata
[−]
[src]
pub fn metadata<P: AsRef<Path>>(path: P) -> Result<Metadata>
Given a path, query the file system to get information about a file, directory, etc.
This function will traverse symbolic links to query information about the destination file.
Examples
fn main() { fn foo() -> std::io::Result<()> { use std::fs; let attr = try!(fs::metadata("/some/file/path.txt")); // inspect attr ... Ok(()) } }use std::fs; let attr = try!(fs::metadata("/some/file/path.txt")); // inspect attr ...
Errors
This function will return an error if the user lacks the requisite
permissions to perform a metadata
call on the given path
or if there
is no entry in the filesystem at the provided path.