Struct std::old_io::FileStatUnstable [-] [+] [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.

Examples

fn main() { use std::old_io::fs::PathExtensions; let info = match Path::new("foo.txt").stat() { Ok(stat) => stat, Err(e) => panic!("couldn't read foo.txt: {}", e), }; println!("byte size: {}", info.size); }

use std::old_io::fs::PathExtensions;

let info = match Path::new("foo.txt").stat() {
    Ok(stat) => stat,
    Err(e) => panic!("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.

Trait Implementations

Derived Implementations

impl Hash for FileStat

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl Copy for FileStat