about summary refs log tree commit diff
path: root/src/libstd/io
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-06-02 22:11:19 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-06-06 22:19:41 -0700
commita3f9aa9ef8657304006fcbe4759a263720b8592c (patch)
tree25003ae61b9ce3227589e87dbd3b1b077ef4d399 /src/libstd/io
parentb830b4b86b39173843a2d660727b9e1854fe8bfb (diff)
downloadrust-a3f9aa9ef8657304006fcbe4759a263720b8592c.tar.gz
rust-a3f9aa9ef8657304006fcbe4759a263720b8592c.zip
rtio: Remove usage of `Path`
The rtio interface is a thin low-level interface over the I/O subsystems, and
the `Path` type is a little too high-level for this interface.
Diffstat (limited to 'src/libstd/io')
-rw-r--r--src/libstd/io/fs.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libstd/io/fs.rs b/src/libstd/io/fs.rs
index a77c7107f28..96ab8989a21 100644
--- a/src/libstd/io/fs.rs
+++ b/src/libstd/io/fs.rs
@@ -410,7 +410,9 @@ pub fn symlink(src: &Path, dst: &Path) -> IoResult<()> {
 /// This function will return an error on failure. Failure conditions include
 /// reading a file that does not exist or reading a file which is not a symlink.
 pub fn readlink(path: &Path) -> IoResult<Path> {
-    LocalIo::maybe_raise(|io| io.fs_readlink(&path.to_c_str()))
+    LocalIo::maybe_raise(|io| {
+        Ok(Path::new(try!(io.fs_readlink(&path.to_c_str()))))
+    })
 }
 
 /// Create a new, empty directory at the provided path
@@ -487,7 +489,9 @@ pub fn rmdir(path: &Path) -> IoResult<()> {
 /// file
 pub fn readdir(path: &Path) -> IoResult<Vec<Path>> {
     LocalIo::maybe_raise(|io| {
-        io.fs_readdir(&path.to_c_str(), 0)
+        Ok(try!(io.fs_readdir(&path.to_c_str(), 0)).move_iter().map(|a| {
+            Path::new(a)
+        }).collect())
     })
 }