提交 49ee4929 编写于 作者: A Alex Crichton

Move std::rt::io to std::io

上级 8b4683d7
......@@ -2839,12 +2839,12 @@ you just have to import it with an `use` statement.
For example, it re-exports `println` which is defined in `std::io::println`:
~~~
use puts = std::rt::io::stdio::println;
use puts = std::io::stdio::println;
fn main() {
println("println is imported per default.");
puts("Doesn't hinder you from importing it under an different name yourself.");
::std::rt::io::stdio::println("Or from not using the automatic import.");
::std::io::stdio::println("Or from not using the automatic import.");
}
~~~
......
......@@ -17,7 +17,7 @@
use std::os;
use std::rt;
use std::rt::io::fs;
use std::io::fs;
use extra::getopts;
use extra::getopts::groups::{optopt, optflag, reqopt};
......
......@@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::rt::io::buffered::BufferedReader;
use std::rt::io::File;
use std::io::buffered::BufferedReader;
use std::io::File;
pub struct ExpectedError { line: uint, kind: ~str, msg: ~str }
......
......@@ -103,8 +103,8 @@ fn xfail_target(config: &config) -> ~str {
}
fn iter_header(testfile: &Path, it: &fn(&str) -> bool) -> bool {
use std::rt::io::buffered::BufferedReader;
use std::rt::io::File;
use std::io::buffered::BufferedReader;
use std::io::File;
let mut rdr = BufferedReader::new(File::open(testfile).unwrap());
loop {
......
......@@ -11,7 +11,7 @@
use std::os;
use std::run;
use std::str;
use std::rt::io::process::ProcessExit;
use std::io::process::ProcessExit;
#[cfg(target_os = "win32")]
fn target_env(lib_path: &str, prog: &str) -> ~[(~str,~str)] {
......
......@@ -8,30 +8,30 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use common::mode_run_pass;
use common::mode_run_fail;
use common::config;
use common::mode_compile_fail;
use common::mode_pretty;
use common::config;
use common::mode_run_fail;
use common::mode_run_pass;
use errors;
use header::load_props;
use header::TestProps;
use header::load_props;
use procsrv;
use util;
use util::logv;
use util;
use std::rt::io;
use std::rt::io::fs;
use std::rt::io::File;
use std::rt::io::process;
use std::rt::io::process::ProcessExit;
use std::io::File;
use std::io::fs;
use std::io::net::ip::{Ipv4Addr, SocketAddr};
use std::io::net::tcp;
use std::io::process::ProcessExit;
use std::io::process;
use std::io::timer;
use std::io;
use std::os;
use std::str;
use std::vec;
use std::rt::io::net::tcp;
use std::rt::io::net::ip::{Ipv4Addr, SocketAddr};
use std::task;
use std::rt::io::timer;
use std::vec;
use extra::test::MetricMap;
......
......@@ -56,8 +56,8 @@ d.write("#[feature(globs, managed_boxes)];\n")
d.write("extern mod extra;\n")
d.write("extern mod run_pass_stage2;\n")
d.write("use run_pass_stage2::*;\n")
d.write("use std::rt::io;\n");
d.write("use std::rt::io::Writer;\n");
d.write("use std::io;\n");
d.write("use std::io::Writer;\n");
d.write("fn main() {\n");
d.write(" let mut out = io::stdout();\n");
i = 0
......
......@@ -97,7 +97,7 @@ pub mod reader {
use std::cast::transmute;
use std::int;
use std::option::{None, Option, Some};
use std::rt::io::extensions::u64_from_be_bytes;
use std::io::extensions::u64_from_be_bytes;
// ebml reading
......@@ -608,10 +608,10 @@ pub mod writer {
use std::cast;
use std::clone::Clone;
use std::rt::io;
use std::rt::io::{Writer, Seek};
use std::rt::io::mem::MemWriter;
use std::rt::io::extensions::u64_to_be_bytes;
use std::io;
use std::io::{Writer, Seek};
use std::io::mem::MemWriter;
use std::io::extensions::u64_to_be_bytes;
// ebml writing
pub struct Encoder {
......@@ -961,8 +961,8 @@ mod tests {
use serialize::Encodable;
use serialize;
use std::rt::io::Decorator;
use std::rt::io::mem::MemWriter;
use std::io::Decorator;
use std::io::mem::MemWriter;
use std::option::{None, Option, Some};
#[test]
......
......@@ -24,8 +24,8 @@
*/
use std::{os, path};
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;
use std::path::is_sep;
use sort;
......
......@@ -20,9 +20,9 @@
use std::cast::transmute;
use std::f64;
use std::hashmap::HashMap;
use std::rt::io;
use std::rt::io::Decorator;
use std::rt::io::mem::MemWriter;
use std::io;
use std::io::Decorator;
use std::io::mem::MemWriter;
use std::num;
use std::str;
use std::to_str;
......@@ -1311,7 +1311,7 @@ mod tests {
use super::*;
use std::rt::io;
use std::io;
use serialize::Decodable;
use treemap::TreeMap;
......@@ -1483,8 +1483,8 @@ fn test_write_object() {
}
fn with_str_writer(f: &fn(@mut io::Writer)) -> ~str {
use std::rt::io::mem::MemWriter;
use std::rt::io::Decorator;
use std::io::mem::MemWriter;
use std::io::Decorator;
use std::str;
let m = @mut MemWriter::new();
......
......@@ -13,7 +13,7 @@
use sort;
use std::cmp;
use std::hashmap;
use std::rt::io;
use std::io;
use std::num;
// NB: this can probably be rewritten in terms of num::Num
......@@ -388,7 +388,7 @@ mod tests {
use stats::Summary;
use stats::write_5_number_summary;
use stats::write_boxplot;
use std::rt::io;
use std::io;
use std::str;
fn check(samples: &[f64], summ: &Summary) {
......@@ -942,8 +942,8 @@ fn test_unif25() {
#[test]
fn test_boxplot_nonpositive() {
fn t(s: &Summary, expected: ~str) {
use std::rt::io::mem::MemWriter;
use std::rt::io::Decorator;
use std::io::mem::MemWriter;
use std::io::Decorator;
let mut m = MemWriter::new();
write_boxplot(&mut m as &mut io::Writer, s, 30);
let out = str::from_utf8_owned(m.inner());
......
......@@ -14,8 +14,8 @@
use std::os;
use std::rand::Rng;
use std::rand;
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;
/// A wrapper for a path to temporary directory implementing automatic
/// scope-pased deletion.
......
......@@ -13,7 +13,7 @@
#[allow(missing_doc)];
use std::rt::io;
use std::io;
#[cfg(not(target_os = "win32"))] use std::os;
#[cfg(not(target_os = "win32"))] use terminfo::*;
......
......@@ -15,7 +15,7 @@
use std::{vec, str};
use std::hashmap::HashMap;
use std::rt::io;
use std::io;
use super::super::TermInfo;
// These are the orders ncurses uses in its compiled format (as of 5.9). Not sure if portable.
......
......@@ -13,8 +13,8 @@
use std::{os, str};
use std::os::getenv;
use std::rt::io;
use std::rt::io::File;
use std::io;
use std::io::File;
/// Return path to database entry for `term`
pub fn get_dbpath_for_term(term: &str) -> Option<~Path> {
......
......@@ -30,8 +30,8 @@
use std::clone::Clone;
use std::comm::{stream, SharedChan, GenericPort, GenericChan};
use std::rt::io;
use std::rt::io::File;
use std::io;
use std::io::File;
use std::task;
use std::to_str::ToStr;
use std::f64;
......@@ -655,9 +655,9 @@ fn len_if_padded(t: &TestDescAndFn) -> uint {
#[test]
fn should_sort_failures_before_printing_them() {
use std::rt::io;
use std::rt::io::Decorator;
use std::rt::io::mem::MemWriter;
use std::io;
use std::io::Decorator;
use std::io::mem::MemWriter;
use std::str;
fn dummy() {}
......
......@@ -10,8 +10,8 @@
#[allow(missing_doc)];
use std::rt::io::Reader;
use std::rt::io::mem::BufReader;
use std::io::Reader;
use std::io::mem::BufReader;
use std::num;
use std::str;
......
......@@ -12,8 +12,8 @@
#[allow(missing_doc)];
use std::rt::io::{Reader, Seek};
use std::rt::io::mem::BufReader;
use std::io::{Reader, Seek};
use std::io::mem::BufReader;
use std::cmp::Eq;
use std::hashmap::HashMap;
use std::to_bytes;
......
......@@ -522,8 +522,8 @@ mod test {
use std::str;
use std::rand;
use std::num::Zero;
use std::rt::io::Decorator;
use std::rt::io::mem::MemWriter;
use std::io::Decorator;
use std::io::mem::MemWriter;
#[test]
fn test_new_nil() {
......
......@@ -18,9 +18,9 @@
use std::cell::Cell;
use std::comm::{PortOne, oneshot};
use std::{str, task};
use std::rt::io;
use std::rt::io::{File, Decorator};
use std::rt::io::mem::MemWriter;
use std::io;
use std::io::{File, Decorator};
use std::io::mem::MemWriter;
/**
*
......@@ -479,7 +479,7 @@ pub fn unwrap(self) -> T {
#[test]
fn test() {
use std::{os, run};
use std::rt::io::fs;
use std::io::fs;
use std::str::from_utf8_owned;
// Create a path to a new file 'filename' in the directory in which
......
......@@ -31,7 +31,7 @@
use std::run;
use std::str;
use std::vec;
use std::rt::io::fs;
use std::io::fs;
use syntax::abi;
use syntax::ast;
use syntax::ast_map::{path, path_mod, path_name, path_pretty_name};
......@@ -968,7 +968,7 @@ pub fn link_binary(sess: Session,
}
fn is_writeable(p: &Path) -> bool {
use std::rt::io;
use std::io;
!p.exists() ||
(match io::result(|| p.stat()) {
......
......@@ -26,9 +26,9 @@
use util::ppaux;
use std::hashmap::{HashMap,HashSet};
use std::rt::io;
use std::rt::io::fs;
use std::rt::io::mem::MemReader;
use std::io;
use std::io::fs;
use std::io::mem::MemReader;
use std::os;
use std::vec;
use extra::getopts::groups::{optopt, optmulti, optflag, optflagopt};
......
......@@ -34,8 +34,8 @@
use middle::lint;
use std::comm;
use std::rt::io;
use std::rt::io::Reader;
use std::io;
use std::io::Reader;
use std::num;
use std::os;
use std::result;
......
......@@ -27,8 +27,8 @@
use std::at_vec;
use std::u64;
use std::rt::io;
use std::rt::io::extensions::u64_from_be_bytes;
use std::io;
use std::io::extensions::u64_from_be_bytes;
use std::option;
use std::str;
use std::vec;
......
......@@ -22,8 +22,8 @@
use middle;
use std::hashmap::{HashMap, HashSet};
use std::rt::io::{Writer, Seek, Decorator};
use std::rt::io::mem::MemWriter;
use std::io::{Writer, Seek, Decorator};
use std::io::mem::MemWriter;
use std::str;
use std::vec;
......
......@@ -11,8 +11,8 @@
use std::option;
use std::os;
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;
use std::hashmap::HashSet;
pub enum FileMatch { FileMatches, FileDoesntMatch }
......
......@@ -25,7 +25,7 @@
use std::c_str::ToCStr;
use std::cast;
use std::rt::io;
use std::io;
use std::num;
use std::option;
use std::os::consts::{macos, freebsd, linux, android, win32};
......
......@@ -11,9 +11,9 @@
// Type encoding
use std::hashmap::HashMap;
use std::rt::io;
use std::rt::io::{Decorator, Writer, Seek};
use std::rt::io::mem::MemWriter;
use std::io;
use std::io::{Decorator, Writer, Seek};
use std::io::mem::MemWriter;
use std::str;
use std::fmt;
......
......@@ -38,7 +38,7 @@
use std::at_vec;
use std::libc;
use std::cast;
use std::rt::io::Seek;
use std::io::Seek;
use extra::ebml::reader;
use extra::ebml;
......@@ -1344,8 +1344,8 @@ fn mk_ctxt() -> @fake_ext_ctxt {
#[cfg(test)]
fn roundtrip(in_item: Option<@ast::item>) {
use std::rt::io::Decorator;
use std::rt::io::mem::MemWriter;
use std::io::Decorator;
use std::io::mem::MemWriter;
let in_item = in_item.unwrap();
let wr = @mut MemWriter::new();
......
......@@ -18,7 +18,7 @@
use std::cast;
use std::rt::io;
use std::io;
use std::uint;
use std::vec;
use std::hashmap::HashMap;
......
......@@ -111,7 +111,7 @@
use std::cast::transmute;
use std::hashmap::HashMap;
use std::rt::io;
use std::io;
use std::str;
use std::to_str;
use std::uint;
......
......@@ -17,7 +17,7 @@
use std::fmt;
use std::local_data;
use std::rt::io;
use std::io;
use syntax::ast;
use syntax::ast_util;
......
......@@ -9,7 +9,7 @@
// except according to those terms.
use std::fmt;
use std::rt::io;
use std::io;
#[deriving(Clone)]
pub struct Layout {
......
......@@ -24,7 +24,7 @@
use std::fmt;
use std::libc;
use std::rt::io;
use std::io;
use std::vec;
/// A unit struct which has the `fmt::Default` trait implemented. When
......
......@@ -39,10 +39,10 @@
use std::fmt;
use std::hashmap::{HashMap, HashSet};
use std::local_data;
use std::rt::io::buffered::BufferedWriter;
use std::rt::io;
use std::rt::io::fs;
use std::rt::io::File;
use std::io::buffered::BufferedWriter;
use std::io;
use std::io::fs;
use std::io::File;
use std::os;
use std::str;
use std::task;
......
......@@ -26,10 +26,10 @@
use std::cell::Cell;
use std::local_data;
use std::rt::io;
use std::rt::io::File;
use std::rt::io::mem::MemWriter;
use std::rt::io::Decorator;
use std::io;
use std::io::File;
use std::io::mem::MemWriter;
use std::io::Decorator;
use std::str;
use extra::getopts;
use extra::getopts::groups;
......
......@@ -10,10 +10,10 @@
// Useful conditions
pub use std::path::Path;
pub use package_id::PkgId;
pub use std::rt::io::FileStat;
pub use std::rt::io::process::ProcessExit;
pub use std::io::FileStat;
pub use std::io::process::ProcessExit;
pub use std::path::Path;
condition! {
pub bad_path: (Path, ~str) -> Path;
......
......@@ -13,8 +13,8 @@
use rustc::metadata::filesearch::rust_path;
use path_util::*;
use std::os;
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;
pub fn list_installed_packages(f: &fn(&PkgId) -> bool) -> bool {
let workspaces = rust_path();
......
......@@ -26,10 +26,10 @@
extern mod syntax;
use std::{os, result, run, str, task};
use std::rt::io::process;
use std::io::process;
use std::hashmap::HashSet;
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;
pub use std::path::Path;
use extra::workcache;
......
......@@ -9,7 +9,7 @@
// except according to those terms.
use extra::term;
use std::rt::io;
use std::io;
pub fn note(msg: &str) {
pretty_message(msg, "note: ", term::color::GREEN,
......
......@@ -12,8 +12,8 @@
use target::*;
use package_id::PkgId;
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;
use std::os;
use context::*;
use crate::Crate;
......
......@@ -19,8 +19,8 @@
use std::libc;
use std::libc::consts::os::posix88::{S_IRUSR, S_IWUSR, S_IXUSR};
use std::os;
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;
use messages::*;
pub fn default_workspace() -> Path {
......
......@@ -12,7 +12,7 @@
use std::{run, str};
use std::run::{ProcessOutput, ProcessOptions, Process};
use std::rt::io::fs;
use std::io::fs;
use extra::tempfile::TempDir;
use version::*;
use path_util::chmod_read_only;
......
......@@ -12,11 +12,11 @@
use context::{BuildContext, Context, RustcFlags};
use std::{os, run, str, task};
use std::rt::io;
use std::rt::io::fs;
use std::rt::io::File;
use std::rt::io::process;
use std::rt::io::process::ProcessExit;
use std::io;
use std::io::fs;
use std::io::File;
use std::io::process;
use std::io::process::ProcessExit;
use extra::arc::Arc;
use extra::arc::RWArc;
use extra::tempfile::TempDir;
......
......@@ -12,7 +12,7 @@
extern mod rustc;
use std::os;
use std::rt::io::File;
use std::io::File;
use rustpkg::api;
use rustpkg::version::NoVersion;
......
......@@ -10,8 +10,8 @@
use std::libc;
use std::os;
use std::rt::io;
use std::rt::io::fs;
use std::io;
use std::io::fs;
use extra::workcache;
use rustc::driver::{driver, session};
use extra::getopts::groups::getopts;
......
......@@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::rt::io;
use std::rt::io::File;
use std::io;
use std::io::File;
use extra::workcache;
use sha1::{Digest, Sha1};
......
......@@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ai = std::rt::io::net::addrinfo;
use ai = std::io::net::addrinfo;
use std::libc::c_int;
use std::ptr::null;
use std::rt::BlockedTask;
......@@ -186,7 +186,7 @@ pub fn accum_addrinfo(addr: &Addrinfo) -> ~[ai::Info] {
#[cfg(test)]
mod test {
use std::rt::io::net::ip::{SocketAddr, Ipv4Addr};
use std::io::net::ip::{SocketAddr, Ipv4Addr};
use super::*;
use super::super::local_loop;
......
......@@ -15,8 +15,8 @@
use std::libc::{c_int, c_char, c_void, size_t};
use std::libc;
use std::rt::BlockedTask;
use std::rt::io::{FileStat, IoError};
use std::rt::io;
use std::io::{FileStat, IoError};
use std::io;
use std::rt::local::Local;
use std::rt::rtio;
use std::rt::sched::{Scheduler, SchedHandle};
......@@ -450,7 +450,7 @@ fn truncate(&mut self, offset: i64) -> Result<(), IoError> {
mod test {
use std::libc::c_int;
use std::libc::{O_CREAT, O_RDWR, O_RDONLY, S_IWUSR, S_IRUSR};
use std::rt::io;
use std::io;
use std::str;
use std::vec;
use super::*;
......
......@@ -61,7 +61,7 @@
use std::unstable::finally::Finally;
use std::vec;
use std::rt::io::IoError;
use std::io::IoError;
pub use self::async::AsyncWatcher;
pub use self::file::{FsRequest, FileWatcher};
......@@ -327,7 +327,7 @@ pub fn uv_error_to_io_error(uverr: UvError) -> IoError {
unsafe {
// Importing error constants
use uvll::*;
use std::rt::io::*;
use std::io::*;
// uv error descriptions are static
let c_desc = uvll::uv_strerror(*uverr);
......
......@@ -33,8 +33,8 @@
)
pub fn dumb_println(args: &fmt::Arguments) {
use std::rt::io::native::stdio::stderr;
use std::rt::io::Writer;
use std::io::native::stdio::stderr;
use std::io::Writer;
let mut out = stderr();
fmt::writeln(&mut out as &mut Writer, args);
......
......@@ -13,8 +13,8 @@
use std::libc::{size_t, ssize_t, c_int, c_void, c_uint, c_char};
use std::ptr;
use std::rt::BlockedTask;
use std::rt::io::IoError;
use std::rt::io::net::ip::{Ipv4Addr, Ipv6Addr, SocketAddr, IpAddr};
use std::io::IoError;
use std::io::net::ip::{Ipv4Addr, Ipv6Addr, SocketAddr, IpAddr};
use std::rt::local::Local;
use std::rt::rtio;
use std::rt::sched::{Scheduler, SchedHandle};
......
......@@ -11,7 +11,7 @@
use std::c_str::CString;
use std::libc;
use std::rt::BlockedTask;
use std::rt::io::IoError;
use std::io::IoError;
use std::rt::local::Local;
use std::rt::rtio::{RtioPipe, RtioUnixListener, RtioUnixAcceptor};
use std::rt::sched::{Scheduler, SchedHandle};
......
......@@ -12,8 +12,8 @@
use std::libc;
use std::ptr;
use std::rt::BlockedTask;
use std::rt::io::IoError;
use std::rt::io::process::*;
use std::io::IoError;
use std::io::process::*;
use std::rt::local::Local;
use std::rt::rtio::RtioProcess;
use std::rt::sched::{Scheduler, SchedHandle};
......
......@@ -9,7 +9,7 @@
// except according to those terms.
use std::libc::c_int;
use std::rt::io::signal::Signum;
use std::io::signal::Signum;
use std::rt::sched::{SchedHandle, Scheduler};
use std::comm::{SharedChan, SendDeferred};
use std::rt::local::Local;
......@@ -78,7 +78,7 @@ mod test {
use super::*;
use std::cell::Cell;
use super::super::local_loop;
use std::rt::io::signal;
use std::io::signal;
use std::comm::{SharedChan, stream};
#[test]
......
......@@ -9,7 +9,7 @@
// except according to those terms.
use std::libc;
use std::rt::io::IoError;
use std::io::IoError;
use std::rt::local::Local;
use std::rt::rtio::RtioTTY;
use std::rt::sched::{Scheduler, SchedHandle};
......
......@@ -13,21 +13,21 @@
use std::libc::c_int;
use std::libc;
use std::path::Path;
use std::rt::io::IoError;
use std::rt::io::net::ip::SocketAddr;
use std::rt::io::process::ProcessConfig;
use std::rt::io;
use std::io::IoError;
use std::io::net::ip::SocketAddr;
use std::io::process::ProcessConfig;
use std::io;
use std::rt::local::Local;
use std::rt::rtio::*;
use std::rt::sched::{Scheduler, SchedHandle};
use std::rt::task::Task;
use std::libc::{O_CREAT, O_APPEND, O_TRUNC, O_RDWR, O_RDONLY, O_WRONLY,
S_IRUSR, S_IWUSR};
use std::rt::io::{FileMode, FileAccess, Open, Append, Truncate, Read, Write,
use std::io::{FileMode, FileAccess, Open, Append, Truncate, Read, Write,
ReadWrite, FileStat};
use std::rt::io::signal::Signum;
use std::io::signal::Signum;
use std::util;
use ai = std::rt::io::net::addrinfo;
use ai = std::io::net::addrinfo;
#[cfg(test)] use std::unstable::run_in_bare_thread;
......
......@@ -220,7 +220,7 @@ fn main() {
```rust
format! // described above
write! // first argument is a &mut rt::io::Writer, the destination
write! // first argument is a &mut io::Writer, the destination
writeln! // same as write but appends a newline
print! // the format string is printed to the standard output
println! // same as print but appends a newline
......@@ -236,7 +236,7 @@ fn main() {
actually invoking the `write` function defined in this module. Example usage is:
```rust
use std::rt::io;
use std::io;
let mut w = io::mem::MemWriter::new();
write!(&mut w as &mut io::Writer, "Hello {}!", "world");
......@@ -462,9 +462,9 @@ fn main() {
use cast;
use char::Char;
use rt::io::Decorator;
use rt::io::mem::MemWriter;
use rt::io;
use io::Decorator;
use io::mem::MemWriter;
use io;
use str;
use repr;
use util;
......
......@@ -29,7 +29,7 @@
use container::Container;
use iter::Iterator;
use option::{Some, None};
use rt::io::Writer;
use io::Writer;
use str::OwnedStr;
use to_bytes::IterBytes;
use vec::ImmutableVector;
......
......@@ -349,6 +349,7 @@ fn inner_mut_ref<'a>(&'a mut self) -> &'a mut S {
mod test {
use prelude::*;
use super::*;
use io;
use super::super::mem::{MemReader, MemWriter};
#[test]
......@@ -427,11 +428,11 @@ fn test_buffered_stream() {
use rt;
struct S;
impl rt::io::Writer for S {
impl io::Writer for S {
fn write(&mut self, _: &[u8]) {}
}
impl rt::io::Reader for S {
impl io::Reader for S {
fn read(&mut self, _: &mut [u8]) -> Option<uint> { None }
fn eof(&mut self) -> bool { true }
}
......
......@@ -15,7 +15,7 @@
use iter::Iterator;
use option::Option;
use rt::io::{Reader, Decorator};
use io::{Reader, Decorator};
/// An iterator that reads a single byte on each iteration,
/// until `.read_byte()` returns `None`.
......@@ -139,8 +139,9 @@ pub fn u64_from_be_bytes(data: &[u8],
#[cfg(test)]
mod test {
use option::{None, Option, Some};
use rt::io::mem::{MemReader, MemWriter};
use rt::io::{Reader, io_error, placeholder_error};
use io::mem::{MemReader, MemWriter};
use io::{Reader, io_error, placeholder_error};
use vec::ImmutableVector;
struct InitialZeroByteReader {
count: int,
......
......@@ -17,7 +17,7 @@
with various filesystem operations. They all operate on a `Path` object.
All operations in this module, including those as part of `File` et al
block the task during execution. Most will raise `std::rt::io::io_error`
block the task during execution. Most will raise `std::io::io_error`
conditions in the event of failure.
Also included in this module is an implementation block on the `Path` object
......@@ -27,7 +27,7 @@
# Example
use std::rt::io::{File, fs};
use std::io::{File, fs};
let path = Path::new("foo.txt");
......@@ -46,17 +46,18 @@
*/
use c_str::ToCStr;
use clone::Clone;
use iter::Iterator;
use super::{Reader, Writer, Seek};
use super::{SeekStyle, Read, Write, Open, IoError, Truncate,
FileMode, FileAccess, FileStat, io_error, FilePermission};
use rt::rtio::{RtioFileStream, IoFactory, with_local_io};
use rt::io;
use io;
use option::{Some, None, Option};
use result::{Ok, Err, Result};
use path;
use path::{Path, GenericPath};
use vec::OwnedVector;
use vec::{OwnedVector, ImmutableVector};
/// Unconstrained file access type that exposes read and write operations
///
......@@ -92,7 +93,7 @@ impl File {
///
/// # Example
///
/// use std::rt::io::{File, io_error, Open, ReadWrite};
/// use std::io::{File, io_error, Open, ReadWrite};
///
/// let p = Path::new("/some/file/path.txt");
///
......@@ -111,7 +112,7 @@ impl File {
///
/// `FileMode` and `FileAccess` provide information about the permissions
/// context in which a given stream is created. More information about them
/// can be found in `std::rt::io`'s docs. If a file is opened with `Write`
/// can be found in `std::io`'s docs. If a file is opened with `Write`
/// or `ReadWrite` access, then it will be created it it does not already
/// exist.
///
......@@ -154,7 +155,7 @@ pub fn open_mode(path: &Path,
///
/// # Example
///
/// use std::rt::io::File;
/// use std::io::File;
///
/// let contents = File::open(&Path::new("foo.txt")).read_to_end();
pub fn open(path: &Path) -> Option<File> {
......@@ -169,7 +170,7 @@ pub fn open(path: &Path) -> Option<File> {
///
/// # Example
///
/// use std::rt::io::File;
/// use std::io::File;
///
/// let mut f = File::create(&Path::new("foo.txt"));
/// f.write(bytes!("This is a sample file"));
......@@ -226,7 +227,7 @@ pub fn truncate(&mut self, offset: i64) {
///
/// # Example
///
/// use std::rt::io::fs;
/// use std::io::fs;
///
/// let p = Path::new("/some/file/path.txt");
/// fs::unlink(&p);
......@@ -256,8 +257,8 @@ pub fn unlink(path: &Path) {
///
/// # Example
///
/// use std::rt::io;
/// use std::rt::io::fs;
/// use std::io;
/// use std::io::fs;
///
/// let p = Path::new("/some/file/path.txt");
/// match io::result(|| fs::stat(&p)) {
......@@ -318,7 +319,7 @@ pub fn lstat(path: &Path) -> FileStat {
///
/// # Example
///
/// use std::rt::io::fs;
/// use std::io::fs;
///
/// fs::rename(&Path::new("foo"), &Path::new("bar"));
/// // Oh boy, nothing was raised!
......@@ -342,7 +343,7 @@ pub fn rename(from: &Path, to: &Path) {
///
/// # Example
///
/// use std::rt::io::fs;
/// use std::io::fs;
///
/// fs::copy(&Path::new("foo.txt"), &Path::new("bar.txt"));
/// // Oh boy, nothing was raised!
......@@ -388,8 +389,8 @@ pub fn copy(from: &Path, to: &Path) {
///
/// # Example
///
/// use std::rt::io;
/// use std::rt::io::fs;
/// use std::io;
/// use std::io::fs;
///
/// fs::chmod(&Path::new("file.txt"), io::UserFile);
/// fs::chmod(&Path::new("file.txt"), io::UserRead | io::UserWrite);
......@@ -453,7 +454,7 @@ pub fn readlink(path: &Path) -> Option<Path> {
/// # Example
///
/// use std::libc::S_IRWXU;
/// use std::rt::io::fs;
/// use std::io::fs;
///
/// let p = Path::new("/some/dir");
/// fs::mkdir(&p, S_IRWXU as int);
......@@ -474,7 +475,7 @@ pub fn mkdir(path: &Path, mode: FilePermission) {
///
/// # Example
///
/// use std::rt::io::fs;
/// use std::io::fs;
///
/// let p = Path::new("/some/dir");
/// fs::rmdir(&p);
......@@ -495,7 +496,7 @@ pub fn rmdir(path: &Path) {
///
/// # Example
///
/// use std::rt::io::fs;
/// use std::io::fs;
///
/// // one possible implementation of fs::walk_dir only visiting files
/// fn visit_dirs(dir: &Path, cb: &fn(&Path)) {
......@@ -716,8 +717,8 @@ pub fn is_dir(&self) -> bool {
#[cfg(test)]
mod test {
use prelude::*;
use rt::io::{SeekSet, SeekCur, SeekEnd, io_error, Read, Open, ReadWrite};
use rt::io;
use io::{SeekSet, SeekCur, SeekEnd, io_error, Read, Open, ReadWrite};
use io;
use str;
use super::{File, rmdir, mkdir, readdir, rmdir_recursive, mkdir_recursive,
copy, unlink, stat, symlink, link, readlink, chmod,
......
......@@ -226,7 +226,7 @@ pub fn with_mem_writer(writeFn:&fn(&mut MemWriter)) -> ~[u8] {
mod test {
use prelude::*;
use super::*;
use rt::io::*;
use io::*;
#[test]
fn test_mem_writer() {
......
......@@ -19,8 +19,6 @@
Readers and Writers may be composed to add capabilities like string
parsing, encoding, and compression.
This will likely live in std::io, not std::rt::io.
# Examples
Some examples of obvious things you might want to do
......@@ -240,16 +238,20 @@
*/
#[allow(missing_doc)];
use cast;
use container::Container;
use int;
use path::Path;
use str::{StrSlice, OwnedStr};
use iter::Iterator;
use option::{Option, Some, None};
use path::Path;
use result::{Ok, Err, Result};
use iter::Iterator;
use str::{StrSlice, OwnedStr};
use to_str::ToStr;
use uint;
use unstable::finally::Finally;
use vec::{OwnedVector, MutableVector};
use vec;
// Reexports
......
......@@ -229,7 +229,7 @@ mod tests {
use libc;
use os;
use prelude::*;
use rt::io::{io_error, SeekSet};
use io::{io_error, SeekSet};
use super::*;
#[ignore(cfg(target_os = "freebsd"))] // hmm, maybe pipes have a tiny buffer
......@@ -714,8 +714,8 @@ fn test_list_dir_root() {
#[test]
fn test_path_is_dir() {
use rt::io::fs::{mkdir_recursive};
use rt::io::{File, UserRWX};
use io::fs::{mkdir_recursive};
use io::{File, UserRWX};
assert!((path_is_dir(&Path::new("."))));
assert!((!path_is_dir(&Path::new("test/stdtest/fs.rs"))));
......@@ -742,8 +742,8 @@ fn test_path_is_dir() {
#[test]
fn test_path_exists() {
use rt::io::fs::mkdir_recursive;
use rt::io::UserRWX;
use io::fs::mkdir_recursive;
use io::UserRWX;
assert!((path_exists(&Path::new("."))));
assert!((!path_exists(&Path::new(
......
......@@ -14,7 +14,7 @@
use os;
use prelude::*;
use ptr;
use rt::io;
use io;
use super::file;
/**
......
......@@ -10,7 +10,7 @@
use libc;
use option::Option;
use rt::io::{Reader, Writer};
use io::{Reader, Writer};
use super::file;
/// Creates a new handle to the stdin of this process
......
......@@ -19,9 +19,10 @@
use option::{Option, Some, None};
use result::{Ok, Err};
use rt::io::{io_error};
use rt::io::net::ip::{SocketAddr, IpAddr};
use io::{io_error};
use io::net::ip::{SocketAddr, IpAddr};
use rt::rtio::{IoFactory, with_local_io};
use vec::ImmutableVector;
/// Hints to the types of sockets that are desired when looking up hosts
pub enum SocketType {
......@@ -110,7 +111,7 @@ fn lookup(hostname: Option<&str>, servname: Option<&str>,
#[cfg(test)]
mod test {
use option::Some;
use rt::io::net::ip::Ipv4Addr;
use io::net::ip::Ipv4Addr;
use super::*;
#[test]
......
......@@ -8,11 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use vec::MutableCloneableVector;
use to_str::ToStr;
use container::Container;
use from_str::FromStr;
use option::{Option, None, Some};
use to_str::ToStr;
use vec::{MutableCloneableVector, ImmutableVector};
pub type Port = u16;
......
......@@ -10,9 +10,9 @@
use option::{Option, Some, None};
use result::{Ok, Err};
use rt::io::net::ip::SocketAddr;
use rt::io::{Reader, Writer, Listener, Acceptor};
use rt::io::{io_error, EndOfFile};
use io::net::ip::SocketAddr;
use io::{Reader, Writer, Listener, Acceptor};
use io::{io_error, EndOfFile};
use rt::rtio::{IoFactory, with_local_io,
RtioSocket, RtioTcpListener, RtioTcpAcceptor, RtioTcpStream};
......@@ -41,7 +41,7 @@ pub fn peer_name(&mut self) -> Option<SocketAddr> {
match self.obj.peer_name() {
Ok(pn) => Some(pn),
Err(ioerr) => {
rtdebug!("failed to get peer name: {:?}", ioerr);
debug!("failed to get peer name: {:?}", ioerr);
io_error::cond.raise(ioerr);
None
}
......@@ -52,7 +52,7 @@ pub fn socket_name(&mut self) -> Option<SocketAddr> {
match self.obj.socket_name() {
Ok(sn) => Some(sn),
Err(ioerr) => {
rtdebug!("failed to get socket name: {:?}", ioerr);
debug!("failed to get socket name: {:?}", ioerr);
io_error::cond.raise(ioerr);
None
}
......@@ -107,7 +107,7 @@ pub fn socket_name(&mut self) -> Option<SocketAddr> {
match self.obj.socket_name() {
Ok(sn) => Some(sn),
Err(ioerr) => {
rtdebug!("failed to get socket name: {:?}", ioerr);
debug!("failed to get socket name: {:?}", ioerr);
io_error::cond.raise(ioerr);
None
}
......@@ -148,8 +148,8 @@ mod test {
use super::*;
use cell::Cell;
use rt::test::*;
use rt::io::net::ip::{Ipv4Addr, SocketAddr};
use rt::io::*;
use io::net::ip::{Ipv4Addr, SocketAddr};
use io::*;
use prelude::*;
use rt::comm::oneshot;
......@@ -514,7 +514,7 @@ fn multiple_connect_interleaved_greedy_schedule_ip4() {
let mut buf = [0];
stream.read(buf);
assert!(buf[0] == i as u8);
rtdebug!("read");
debug!("read");
}
}
}
......@@ -526,11 +526,11 @@ fn connect(i: int, addr: SocketAddr) {
if i == MAX { return }
do spawntask {
rtdebug!("connecting");
debug!("connecting");
let mut stream = TcpStream::connect(addr);
// Connect again before writing
connect(i + 1, addr);
rtdebug!("writing");
debug!("writing");
stream.write([i as u8]);
}
}
......@@ -556,7 +556,7 @@ fn multiple_connect_interleaved_greedy_schedule_ip6() {
let mut buf = [0];
stream.read(buf);
assert!(buf[0] == i as u8);
rtdebug!("read");
debug!("read");
}
}
}
......@@ -568,11 +568,11 @@ fn connect(i: int, addr: SocketAddr) {
if i == MAX { return }
do spawntask {
rtdebug!("connecting");
debug!("connecting");
let mut stream = TcpStream::connect(addr);
// Connect again before writing
connect(i + 1, addr);
rtdebug!("writing");
debug!("writing");
stream.write([i as u8]);
}
}
......@@ -598,7 +598,7 @@ fn multiple_connect_interleaved_lazy_schedule_ip4() {
let mut buf = [0];
stream.read(buf);
assert!(buf[0] == 99);
rtdebug!("read");
debug!("read");
}
}
}
......@@ -610,11 +610,11 @@ fn connect(i: int, addr: SocketAddr) {
if i == MAX { return }
do spawntask_later {
rtdebug!("connecting");
debug!("connecting");
let mut stream = TcpStream::connect(addr);
// Connect again before writing
connect(i + 1, addr);
rtdebug!("writing");
debug!("writing");
stream.write([99]);
}
}
......@@ -639,7 +639,7 @@ fn multiple_connect_interleaved_lazy_schedule_ip6() {
let mut buf = [0];
stream.read(buf);
assert!(buf[0] == 99);
rtdebug!("read");
debug!("read");
}
}
}
......@@ -651,11 +651,11 @@ fn connect(i: int, addr: SocketAddr) {
if i == MAX { return }
do spawntask_later {
rtdebug!("connecting");
debug!("connecting");
let mut stream = TcpStream::connect(addr);
// Connect again before writing
connect(i + 1, addr);
rtdebug!("writing");
debug!("writing");
stream.write([99]);
}
}
......
......@@ -10,9 +10,9 @@
use option::{Option, Some, None};
use result::{Ok, Err};
use rt::io::net::ip::SocketAddr;
use rt::io::{Reader, Writer};
use rt::io::{io_error, EndOfFile};
use io::net::ip::SocketAddr;
use io::{Reader, Writer};
use io::{io_error, EndOfFile};
use rt::rtio::{RtioSocket, RtioUdpSocket, IoFactory, with_local_io};
pub struct UdpSocket {
......@@ -60,7 +60,7 @@ pub fn socket_name(&mut self) -> Option<SocketAddr> {
match self.obj.socket_name() {
Ok(sn) => Some(sn),
Err(ioerr) => {
rtdebug!("failed to get socket name: {:?}", ioerr);
debug!("failed to get socket name: {:?}", ioerr);
io_error::cond.raise(ioerr);
None
}
......@@ -106,8 +106,8 @@ fn write(&mut self, buf: &[u8]) {
mod test {
use super::*;
use rt::test::*;
use rt::io::net::ip::{Ipv4Addr, SocketAddr};
use rt::io::*;
use io::net::ip::{Ipv4Addr, SocketAddr};
use io::*;
use option::{Some, None};
use rt::comm::oneshot;
use cell::Cell;
......
......@@ -27,8 +27,8 @@
use c_str::ToCStr;
use rt::rtio::{IoFactory, RtioUnixListener, with_local_io};
use rt::rtio::{RtioUnixAcceptor, RtioPipe};
use rt::io::pipe::PipeStream;
use rt::io::{io_error, Listener, Acceptor, Reader, Writer};
use io::pipe::PipeStream;
use io::{io_error, Listener, Acceptor, Reader, Writer};
/// A stream which communicates over a named pipe.
pub struct UnixStream {
......@@ -52,7 +52,7 @@ fn new(obj: ~RtioPipe) -> UnixStream {
///
/// # Example
///
/// use std::rt::io::net::unix::UnixStream;
/// use std::io::net::unix::UnixStream;
///
/// let server = Path("path/to/my/socket");
/// let mut stream = UnixStream::connect(&server);
......@@ -98,7 +98,7 @@ impl UnixListener {
///
/// # Example
///
/// use std::rt::io::net::unix::UnixListener;
/// use std::io::net::unix::UnixListener;
///
/// let server = Path("path/to/my/socket");
/// let mut stream = UnixListener::bind(&server);
......@@ -154,7 +154,7 @@ mod tests {
use super::*;
use cell::Cell;
use rt::test::*;
use rt::io::*;
use io::*;
use rt::comm::oneshot;
fn smalltest(server: ~fn(UnixStream), client: ~fn(UnixStream)) {
......
......@@ -15,8 +15,8 @@
use prelude::*;
use super::{Reader, Writer};
use rt::io::{io_error, EndOfFile};
use rt::io::native::file;
use io::{io_error, EndOfFile};
use io::native::file;
use rt::rtio::{RtioPipe, with_local_io};
pub struct PipeStream {
......@@ -34,7 +34,7 @@ impl PipeStream {
/// # Example
///
/// use std::libc;
/// use std::rt::io::pipe;
/// use std::io::pipe;
///
/// let mut pipe = PipeStream::open(libc::STDERR_FILENO);
/// pipe.write(bytes!("Hello, stderr!"));
......
......@@ -14,8 +14,8 @@
use cell::Cell;
use libc;
use rt::io;
use rt::io::io_error;
use io;
use io::io_error;
use rt::rtio::{RtioProcess, IoFactory, with_local_io};
use fmt;
......
......@@ -19,12 +19,13 @@
*/
use container::{Map, MutableMap};
use clone::Clone;
use comm::{Port, SharedChan, stream};
use container::{Map, MutableMap};
use hashmap;
use io::io_error;
use option::{Some, None};
use result::{Err, Ok};
use rt::io::io_error;
use rt::rtio::{IoFactory, RtioSignal, with_local_io};
#[repr(int)]
......@@ -61,7 +62,7 @@ pub enum Signum {
/// # Example
///
/// ```rust
/// use std::rt::io::signal::{Listener, Interrupt};
/// use std::io::signal::{Listener, Interrupt};
///
/// let mut listener = Listener::new();
/// listener.register(signal::Interrupt);
......@@ -148,7 +149,7 @@ pub fn unregister(&mut self, signum: Signum) {
#[cfg(test)]
mod test {
use libc;
use rt::io::timer;
use io::timer;
use super::{Listener, Interrupt};
use comm::{GenericPort, Peekable};
......@@ -207,7 +208,7 @@ fn test_io_signal_unregister() {
#[cfg(windows)]
#[test]
fn test_io_signal_invalid_signum() {
use rt::io;
use io;
use super::User1;
let mut s = Listener::new();
let mut called = false;
......
......@@ -18,7 +18,7 @@
# Example
```rust
use std::rt::io;
use std::io;
let mut out = io::stdout();
out.write(bytes!("Hello, world!"));
......@@ -30,7 +30,7 @@
use libc;
use option::{Option, Some, None};
use result::{Ok, Err};
use rt::io::buffered::LineBufferedWriter;
use io::buffered::LineBufferedWriter;
use rt::rtio::{IoFactory, RtioTTY, RtioFileStream, with_local_io,
CloseAsynchronously};
use super::{Reader, Writer, io_error, IoError, OtherIoError,
......
......@@ -19,7 +19,7 @@
```rust
use std::rt::io::Timer;
use std::io::Timer;
let mut timer = Timer::new().unwrap();
timer.sleep(10); // block the task for awhile
......@@ -41,7 +41,7 @@
use comm::{Port, PortOne};
use option::{Option, Some, None};
use result::{Ok, Err};
use rt::io::io_error;
use io::io_error;
use rt::rtio::{IoFactory, RtioTimer, with_local_io};
pub struct Timer {
......@@ -64,7 +64,7 @@ pub fn new() -> Option<Timer> {
match io.timer_init() {
Ok(t) => Some(Timer { obj: t }),
Err(ioerr) => {
rtdebug!("Timer::init: failed to init: {:?}", ioerr);
debug!("Timer::init: failed to init: {:?}", ioerr);
io_error::cond.raise(ioerr);
None
}
......
......@@ -21,7 +21,7 @@
//! boxes (`owned`), and unsafe and borrowed pointers (`ptr`, `borrowed`).
//! Additionally, `std` provides pervasive types (`option` and `result`),
//! task creation and communication primitives (`task`, `comm`), platform
//! abstractions (`os` and `path`), basic I/O abstractions (`rt::io`), common
//! abstractions (`os` and `path`), basic I/O abstractions (`io`), common
//! traits (`kinds`, `ops`, `cmp`, `num`, `to_str`), and complete bindings
//! to the C standard library (`libc`).
//!
......@@ -68,7 +68,7 @@
#[allow(cstack)]; // NOTE: remove after the next snapshot.
// When testing libstd, bring in libuv as the I/O backend so tests can print
// things and all of the std::rt::io tests have an I/O interface to run on top
// things and all of the std::io tests have an I/O interface to run on top
// of
#[cfg(test)] extern mod rustuv(vers = "0.9-pre");
......@@ -179,6 +179,7 @@ pub mod linkhack {
pub mod libc;
pub mod c_str;
pub mod os;
pub mod io;
pub mod path;
pub mod rand;
pub mod run;
......@@ -225,6 +226,7 @@ mod std {
pub use logging;
pub use option;
pub use os;
pub use io;
pub use rt;
pub use str;
pub use to_bytes;
......
......@@ -388,7 +388,7 @@ fn load_self() -> Option<~[u8]> {
#[cfg(target_os = "linux")]
#[cfg(target_os = "android")]
fn load_self() -> Option<~[u8]> {
use std::rt::io;
use std::io;
match io::result(|| io::fs::readlink(&Path::new("/proc/self/exe"))) {
Ok(Some(path)) => Some(path.as_vec().to_owned()),
......@@ -1447,8 +1447,8 @@ fn memory_map_file() {
use result::{Ok, Err};
use os::*;
use libc::*;
use rt::io;
use rt::io::fs;
use io;
use io::fs;
#[cfg(unix)]
fn lseek_(fd: c_int, size: uint) {
......
......@@ -40,7 +40,7 @@
// Reexported functions
pub use from_str::from_str;
pub use iter::range;
pub use rt::io::stdio::{print, println};
pub use io::stdio::{print, println};
// Reexported types and traits
......@@ -67,7 +67,7 @@
pub use num::{Primitive, Int, Float, ToStrRadix, ToPrimitive, FromPrimitive};
pub use path::{GenericPath, Path, PosixPath, WindowsPath};
pub use ptr::RawPtr;
pub use rt::io::{Writer, Reader, Seek};
pub use io::{Writer, Reader, Seek};
pub use send_str::{SendStr, SendStrOwned, SendStrStatic, IntoSendStr};
pub use str::{Str, StrVector, StrSlice, OwnedStr};
pub use to_bytes::IterBytes;
......
......@@ -17,7 +17,7 @@
#[cfg(unix)]
use rand::reader::ReaderRng;
#[cfg(unix)]
use rt::io::File;
use io::File;
#[cfg(windows)]
use cast;
......
......@@ -11,7 +11,7 @@
//! A wrapper around any Reader to treat it as an RNG.
use option::{Some, None};
use rt::io::Reader;
use io::Reader;
use rand::Rng;
......@@ -24,7 +24,7 @@
///
/// ```rust
/// use std::rand::{reader, Rng};
/// use std::rt::io::mem;
/// use std::io::mem;
///
/// fn main() {
/// let mut rng = reader::ReaderRng::new(mem::MemReader::new(~[1,2,3,4,5,6,7,8]));
......@@ -77,7 +77,7 @@ fn fill_bytes(&mut self, v: &mut [u8]) {
#[cfg(test)]
mod test {
use super::*;
use rt::io::mem::MemReader;
use io::mem::MemReader;
use cast;
#[test]
......
......@@ -19,7 +19,7 @@
use cast::transmute;
use char;
use container::Container;
use rt::io;
use io;
use iter::Iterator;
use libc::c_void;
use option::{Some, None};
......@@ -621,8 +621,8 @@ pub fn write_repr<T>(writer: &mut io::Writer, object: &T) {
pub fn repr_to_str<T>(t: &T) -> ~str {
use str;
use rt::io;
use rt::io::Decorator;
use io;
use io::Decorator;
let mut result = io::mem::MemWriter::new();
write_repr(&mut result as &mut io::Writer, t);
......@@ -637,7 +637,7 @@ fn test_repr() {
use prelude::*;
use str;
use str::Str;
use rt::io::Decorator;
use io::Decorator;
use util::swap;
use char::is_alphabetic;
......
......@@ -12,9 +12,9 @@
use from_str::from_str;
use libc::exit;
use option::{Some, None, Option};
use rt::io;
use rt::io::stdio::StdWriter;
use rt::io::buffered::LineBufferedWriter;
use io;
use io::stdio::StdWriter;
use io::buffered::LineBufferedWriter;
use rt::crate_map::{ModEntry, CrateMap, iter_crate_map, get_crate_map};
use str::StrSlice;
use u32;
......
......@@ -116,8 +116,10 @@ pub mod shouldnt_be_public {
/// The coroutine task scheduler, built on the `io` event loop.
pub mod sched;
/// Synchronous I/O.
pub mod io;
#[cfg(stage0)]
pub mod io {
pub use io::stdio;
}
/// The EventLoop and internal synchronous I/O interface.
pub mod rtio;
......
......@@ -8,21 +8,21 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use c_str::CString;
use comm::{SharedChan, PortOne, Port};
use libc::c_int;
use libc;
use option::*;
use path::Path;
use result::*;
use comm::{SharedChan, PortOne, Port};
use libc::c_int;
use c_str::CString;
use ai = rt::io::net::addrinfo;
use rt::io::IoError;
use rt::io::signal::Signum;
use super::io::process::{ProcessConfig, ProcessExit};
use super::io::net::ip::{IpAddr, SocketAddr};
use path::Path;
use super::io::{SeekStyle};
use super::io::{FileMode, FileAccess, FileStat, FilePermission};
use ai = io::net::addrinfo;
use io::IoError;
use io::net::ip::{IpAddr, SocketAddr};
use io::process::{ProcessConfig, ProcessExit};
use io::signal::Signum;
use io::{FileMode, FileAccess, FileStat, FilePermission};
use io::{SeekStyle};
pub trait Callback {
fn call(&mut self);
......@@ -78,7 +78,7 @@ pub enum CloseBehavior {
pub fn with_local_io<T>(f: &fn(&mut IoFactory) -> Option<T>) -> Option<T> {
use rt::sched::Scheduler;
use rt::local::Local;
use rt::io::{io_error, standard_error, IoUnavailable};
use io::{io_error, standard_error, IoUnavailable};
unsafe {
let sched: *mut Scheduler = Local::unsafe_borrow();
......
......@@ -1133,7 +1133,7 @@ fn test_stress_schedule_task_states() {
#[test]
fn test_io_callback() {
use rt::io::timer;
use io::timer;
// This is a regression test that when there are no schedulable tasks
// in the work queue, but we are performing I/O, that once we do put
......
......@@ -29,7 +29,7 @@
use rt::context::Context;
use rt::context;
use rt::env;
use rt::io::Writer;
use io::Writer;
use rt::kill::Death;
use rt::local::Local;
use rt::logging::StdErrLogger;
......
......@@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use super::io::net::ip::{SocketAddr, Ipv4Addr, Ipv6Addr};
use io::net::ip::{SocketAddr, Ipv4Addr, Ipv6Addr};
use cell::Cell;
use clone::Clone;
......
......@@ -68,8 +68,8 @@ pub fn default_sched_threads() -> uint {
}
pub fn dumb_println(args: &fmt::Arguments) {
use rt::io::native::stdio::stderr;
use rt::io::{Writer, io_error, ResourceUnavailable};
use io::native::stdio::stderr;
use io::{Writer, io_error, ResourceUnavailable};
use rt::task::Task;
use rt::local::Local;
......
......@@ -14,13 +14,13 @@
use cell::Cell;
use comm::{stream, SharedChan};
use io::Reader;
use io::process::ProcessExit;
use io::process;
use io;
use libc::{pid_t, c_int};
use libc;
use prelude::*;
use rt::io::process;
use rt::io::process::ProcessExit;
use rt::io;
use rt::io::Reader;
use task;
/**
......@@ -335,8 +335,8 @@ mod tests {
use str;
use task::spawn;
use unstable::running_on_valgrind;
use rt::io::native::file;
use rt::io::{Writer, Reader};
use io::native::file;
use io::{Writer, Reader};
#[test]
#[cfg(not(target_os="android"))] // FIXME(#10380)
......
......@@ -358,8 +358,8 @@ pub trait ToBytes {
impl<A:IterBytes> ToBytes for A {
fn to_bytes(&self, lsb0: bool) -> ~[u8] {
use rt::io::mem;
use rt::io::Writer;
use io::mem;
use io::Writer;
do mem::with_mem_writer |wr| {
do self.iter_bytes(lsb0) |bytes| {
......
......@@ -11,7 +11,7 @@
use codemap::{Pos, Span};
use codemap;
use std::rt::io;
use std::io;
use std::local_data;
use extra::term;
......
......@@ -945,10 +945,10 @@ mod $c {
format_args!(|args| { ::std::fmt::writeln($dst, args) }, $($arg)*)
))
macro_rules! print (
($($arg:tt)*) => (format_args!(::std::rt::io::stdio::print_args, $($arg)*))
($($arg:tt)*) => (format_args!(::std::io::stdio::print_args, $($arg)*))
)
macro_rules! println (
($($arg:tt)*) => (format_args!(::std::rt::io::stdio::println_args, $($arg)*))
($($arg:tt)*) => (format_args!(::std::io::stdio::println_args, $($arg)*))
)
macro_rules! local_data_key (
......@@ -1436,7 +1436,7 @@ fn renaming () {
}
fn fake_print_crate(crate: &ast::Crate) {
let out = @mut std::rt::io::stderr() as @mut std::rt::io::Writer;
let out = @mut std::io::stderr() as @mut std::io::Writer;
let s = pprust::rust_printer(out, get_ident_interner());
pprust::print_crate_(s, crate);
}
......
......@@ -19,8 +19,8 @@
use parse::token::{get_ident_interner};
use print::pprust;
use std::rt::io;
use std::rt::io::File;
use std::io;
use std::io::File;
use std::str;
// These macros all relate to the file system; they either return
......
......@@ -18,7 +18,7 @@
use parse::token;
use parse::token::{get_ident_interner};
use std::rt::io;
use std::io;
use std::str;
use std::uint;
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册