about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorZiad Hatahet <hatahet@gmail.com>2013-10-22 18:25:07 -0700
committerZiad Hatahet <hatahet@gmail.com>2013-10-22 18:25:07 -0700
commit60245b9290388671edac86d6db1619f60a9ccb68 (patch)
treeb2014dac3d775c584a6319df198b58b0cbdca0b9 /src/libstd/rt
parentb477f7a7b74615bba9ab3074082f9cc76a24e8a3 (diff)
downloadrust-60245b9290388671edac86d6db1619f60a9ccb68.tar.gz
rust-60245b9290388671edac86d6db1619f60a9ccb68.zip
Remove thread-blocking call to `libc::stat` in `Path::stat`
Fixes #9958
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/io/file.rs4
-rw-r--r--src/libstd/rt/io/mod.rs6
-rw-r--r--src/libstd/rt/uv/uvio.rs3
3 files changed, 11 insertions, 2 deletions
diff --git a/src/libstd/rt/io/file.rs b/src/libstd/rt/io/file.rs
index a5d593d2454..e25b03be361 100644
--- a/src/libstd/rt/io/file.rs
+++ b/src/libstd/rt/io/file.rs
@@ -59,8 +59,8 @@ use path::Path;
 ///     }).inside {
 ///         let stream = match open(p, Create, ReadWrite) {
 ///             Some(s) => s,
-///             None => fail!("whoops! I'm sure this raised, anyways..");
-///         }
+///             None => fail!("whoops! I'm sure this raised, anyways..")
+///         };
 ///         // do some stuff with that stream
 ///
 ///         // the file stream will be closed at the end of this block
diff --git a/src/libstd/rt/io/mod.rs b/src/libstd/rt/io/mod.rs
index c0971b5d3cd..97d44da765a 100644
--- a/src/libstd/rt/io/mod.rs
+++ b/src/libstd/rt/io/mod.rs
@@ -654,6 +654,12 @@ pub struct FileStat {
     is_file: bool,
     /// `true` if the file pointed at by the `PathInfo` is a directory
     is_dir: bool,
+    /// The file pointed at by the `PathInfo`'s device
+    device: u64,
+    /// The file pointed at by the `PathInfo`'s mode
+    mode: u64,
+    /// The file pointed at by the `PathInfo`'s inode
+    inode: u64,
     /// The file pointed at by the `PathInfo`'s size in bytes
     size: u64,
     /// The file pointed at by the `PathInfo`'s creation time
diff --git a/src/libstd/rt/uv/uvio.rs b/src/libstd/rt/uv/uvio.rs
index d5893d6d014..c7e51b3485d 100644
--- a/src/libstd/rt/uv/uvio.rs
+++ b/src/libstd/rt/uv/uvio.rs
@@ -635,6 +635,9 @@ impl IoFactory for UvIoFactory {
                                 path: Path::new(path_str.as_slice()),
                                 is_file: stat.is_file(),
                                 is_dir: stat.is_dir(),
+                                device: stat.st_dev,
+                                mode: stat.st_mode,
+                                inode: stat.st_ino,
                                 size: stat.st_size,
                                 created: stat.st_ctim.tv_sec as u64,
                                 modified: stat.st_mtim.tv_sec as u64,