From f19d0833625c382c5d0a8868924cd4620335e659 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 29 Oct 2013 23:31:07 -0700 Subject: Fill out the remaining functionality in io::file This adds bindings to the remaining functions provided by libuv, all of which are useful operations on files which need to get exposed somehow. Some highlights: * Dropped `FileReader` and `FileWriter` and `FileStream` for one `File` type * Moved all file-related methods to be static methods under `File` * All directory related methods are still top-level functions * Created `io::FilePermission` types (backed by u32) that are what you'd expect * Created `io::FileType` and refactored `FileStat` to use FileType and FilePermission * Removed the expanding matrix of `FileMode` operations. The mode of reading a file will not have the O_CREAT flag, but a write mode will always have the O_CREAT flag. Closes #10130 Closes #10131 Closes #10121 --- src/libsyntax/parse/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index cd1be9a3c16..fbe711b5efe 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -19,9 +19,8 @@ use parse::attr::parser_attr; use parse::lexer::reader; use parse::parser::Parser; -use std::path::Path; use std::rt::io; -use std::rt::io::file; +use std::rt::io::File; use std::str; pub mod lexer; @@ -268,7 +267,7 @@ pub fn file_to_filemap(sess: @mut ParseSess, path: &Path, spanopt: Option) None => sess.span_diagnostic.handler().fatal(msg), } }; - let bytes = match io::result(|| file::open(path).read_to_end()) { + let bytes = match io::result(|| File::open(path).read_to_end()) { Ok(bytes) => bytes, Err(e) => { err(format!("couldn't read {}: {}", path.display(), e.desc)); -- cgit 1.4.1-3-g733a5