Struct std::io::FileStat
pub struct FileStat { path: Path, size: u64, kind: FileType, perm: FilePermission, created: u64, modified: u64, accessed: u64, unstable: UnstableFileStat, }
A structure used to describe metadata information about a file. This
structure is created through the stat
method on a Path
.
Example
let info = match Path::new("foo.txt").stat() { Ok(stat) => stat, Err(e) => fail!("couldn't read foo.txt: {}", e), }; println!("path: {}", info.path.display()); println!("byte size: {}", info.size);
Fields
path | The path that this stat structure is describing |
size | The size of the file, in bytes |
kind | The kind of file this path points to (directory, file, pipe, etc.) |
perm | The file permissions currently on the file |
created | The time that the file was created at, in platform-dependent milliseconds |
modified | The time that this file was last modified, in platform-dependent milliseconds |
accessed | The time that this file was last accessed, in platform-dependent milliseconds |
unstable | Information returned by stat() which is not guaranteed to be platform-independent. This information may be useful on some platforms, but it may have different meanings or no meaning at all on other platforms. Usage of this field is discouraged, but if access is desired then the fields are located here. |
Trait Implementations
Derived Implementations
impl<__S: Writer> Hash<__S> for FileStat
fn hash(&self, __arg_0: &mut __S)
Compute a hash of the value.