std: expose more stat info

This commit is contained in:
Jeff Olson 2013-09-16 13:24:23 -07:00
parent 63182885d8
commit 25b4d8c1d7
2 changed files with 7 additions and 7 deletions

View File

@ -610,13 +610,10 @@ pub struct FileStat {
/// `true` if the file pointed at by the `PathInfo` is a regular file
is_file: bool,
/// `true` if the file pointed at by the `PathInfo` is a directory
is_dir: bool
// `true` if the file pointed at by the `PathInfo` is a link (what this means
// is platform dependant)
/*
is_dir: bool,
/// The file pointed at by the `PathInfo`'s size in bytes
size: u64,
/// The file pointed at by the `PathInfo`'s time date in platform-dependent msecs
/// The file pointed at by the `PathInfo`'s creation time
created: u64,
/// The file pointed at by the `PathInfo`'s last-modification time in
/// platform-dependent msecs
@ -624,5 +621,4 @@ pub struct FileStat {
/// The file pointed at by the `PathInfo`'s last-accessd time (e.g. read) in
/// platform-dependent msecs
accessed: u64,
*/
}

View File

@ -635,7 +635,11 @@ impl IoFactory for UvIoFactory {
Ok(FileStat {
path: Path(path_str),
is_file: stat.is_file(),
is_dir: stat.is_dir()
is_dir: stat.is_dir(),
size: stat.st_size,
created: stat.st_ctim.tv_sec as u64,
modified: stat.st_mtim.tv_sec as u64,
accessed: stat.st_atim.tv_sec as u64
})
},
Some(e) => {