Struct std::io::FileStat[src]
pub struct FileStat {
pub size: u64,
pub kind: FileType,
pub perm: FilePermission,
pub created: u64,
pub modified: u64,
pub accessed: u64,
pub unstable: UnstableFileStat,
}A structure used to describe metadata information about a file. This
structure is created through the stat method on a Path.
Example
fn main() {} fn foo() { let info = match Path::new("foo.txt").stat() { Ok(stat) => stat, Err(e) => fail!("couldn't read foo.txt: {}", e), }; println!("byte size: {}", info.size); }let info = match Path::new("foo.txt").stat() { Ok(stat) => stat, Err(e) => fail!("couldn't read foo.txt: {}", e), }; println!("byte size: {}", info.size);
Fields
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. |