From 25b4d8c1d7de70bab8eca8a57fdfb703e5e281c9 Mon Sep 17 00:00:00 2001 From: Jeff Olson Date: Mon, 16 Sep 2013 13:24:23 -0700 Subject: std: expose more stat info --- src/libstd/rt/io/mod.rs | 8 ++------ src/libstd/rt/uv/uvio.rs | 6 +++++- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/libstd/rt') diff --git a/src/libstd/rt/io/mod.rs b/src/libstd/rt/io/mod.rs index 16c8a9deea0..afef369fa44 100644 --- a/src/libstd/rt/io/mod.rs +++ b/src/libstd/rt/io/mod.rs @@ -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, - */ } diff --git a/src/libstd/rt/uv/uvio.rs b/src/libstd/rt/uv/uvio.rs index 88d168c85d2..d701a87004c 100644 --- a/src/libstd/rt/uv/uvio.rs +++ b/src/libstd/rt/uv/uvio.rs @@ -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) => { -- cgit 1.4.1-3-g733a5