From d187dc574bd51fa3947408f8430368a85f83447d Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Thu, 29 Jan 2015 08:29:31 +0100 Subject: [PATCH] std::io -> std::old_io --- mkmain.rs | 2 +- mkuutils.rs | 2 +- src/base64/base64.rs | 4 ++-- src/basename/basename.rs | 2 +- src/cat/cat.rs | 6 +++--- src/chmod/chmod.rs | 6 +++--- src/chroot/chroot.rs | 2 +- src/cksum/cksum.rs | 4 ++-- src/cksum/gen_table.rs | 2 +- src/comm/comm.rs | 8 ++++---- src/common/util.rs | 28 ++++++++++++++-------------- src/cp/cp.rs | 4 ++-- src/cut/buffer.rs | 6 +++--- src/cut/cut.rs | 10 +++++----- src/dirname/dirname.rs | 2 +- src/du/du.rs | 2 +- src/echo/echo.rs | 2 +- src/env/env.rs | 4 ++-- src/expand/expand.rs | 2 +- src/factor/factor.rs | 4 ++-- src/fmt/fmt.rs | 4 ++-- src/fmt/parasplit.rs | 2 +- src/fold/fold.rs | 6 +++--- src/hashsum/hashsum.rs | 10 +++++----- src/head/head.rs | 6 +++--- src/hostname/hostname.rs | 2 +- src/kill/kill.rs | 2 +- src/link/link.rs | 2 +- src/logname/logname.rs | 2 +- src/mkdir/mkdir.rs | 4 ++-- src/mv/mv.rs | 6 +++--- src/nice/nice.rs | 2 +- src/nl/nl.rs | 6 +++--- src/nohup/nohup.rs | 10 +++++----- src/od/od.rs | 2 +- src/paste/paste.rs | 2 +- src/printenv/printenv.rs | 2 +- src/pwd/pwd.rs | 2 +- src/readlink/readlink.rs | 4 ++-- src/realpath/realpath.rs | 6 +++--- src/rm/rm.rs | 4 ++-- src/rmdir/rmdir.rs | 4 ++-- src/shuf/shuf.rs | 4 ++-- src/sleep/sleep.rs | 2 +- src/sort/sort.rs | 4 ++-- src/split/split.rs | 2 +- src/stdbuf/stdbuf.rs | 4 ++-- src/sum/sum.rs | 4 ++-- src/tac/tac.rs | 2 +- src/tail/tail.rs | 8 ++++---- src/tee/tee.rs | 6 +++--- src/test/test.rs | 4 ++-- src/timeout/timeout.rs | 4 ++-- src/touch/touch.rs | 12 ++++++------ src/tr/tr.rs | 4 ++-- src/truncate/truncate.rs | 4 ++-- src/tsort/tsort.rs | 2 +- src/tty/tty.rs | 4 ++-- src/uname/uname.rs | 2 +- src/unexpand/unexpand.rs | 2 +- src/uniq/uniq.rs | 2 +- src/unlink/unlink.rs | 6 +++--- src/uptime/uptime.rs | 2 +- src/users/users.rs | 2 +- src/wc/wc.rs | 6 +++--- src/whoami/whoami.rs | 2 +- src/yes/yes.rs | 2 +- test/cat.rs | 2 +- test/cp.rs | 6 +++--- test/mkdir.rs | 4 ++-- test/mv.rs | 6 +++--- test/nl.rs | 2 +- test/seq.rs | 2 +- test/sort.rs | 4 ++-- test/test.rs | 2 +- test/tr.rs | 2 +- test/truncate.rs | 4 ++-- test/unexpand.rs | 2 +- 78 files changed, 162 insertions(+), 162 deletions(-) diff --git a/mkmain.rs b/mkmain.rs index 612d07b98..1bc7654dd 100644 --- a/mkmain.rs +++ b/mkmain.rs @@ -1,6 +1,6 @@ #![allow(unstable)] -use std::io::{File, Truncate, ReadWrite}; +use std::old_io::{File, Truncate, ReadWrite}; use std::os; use std::path::Path; diff --git a/mkuutils.rs b/mkuutils.rs index 7a8bc729e..f097b1517 100644 --- a/mkuutils.rs +++ b/mkuutils.rs @@ -1,6 +1,6 @@ #![allow(unstable)] -use std::io::{File, Truncate, Write}; +use std::old_io::{File, Truncate, Write}; use std::os; use std::path::Path; diff --git a/src/base64/base64.rs b/src/base64/base64.rs index 2163c0b06..0d22c23d2 100644 --- a/src/base64/base64.rs +++ b/src/base64/base64.rs @@ -17,8 +17,8 @@ extern crate libc; use std::ascii::AsciiExt; use std::error::Error; -use std::io::{println, File, stdout}; -use std::io::stdio::stdin_raw; +use std::old_io::{println, File, stdout}; +use std::old_io::stdio::stdin_raw; use getopts::{ getopts, diff --git a/src/basename/basename.rs b/src/basename/basename.rs index 9e38d0d12..21b37ea5b 100644 --- a/src/basename/basename.rs +++ b/src/basename/basename.rs @@ -14,7 +14,7 @@ extern crate getopts; extern crate libc; use std::borrow::ToOwned; -use std::io::{print, println}; +use std::old_io::{print, println}; #[path = "../common/util.rs"] #[macro_use] diff --git a/src/cat/cat.rs b/src/cat/cat.rs index d560cf908..7fbfa20b1 100644 --- a/src/cat/cat.rs +++ b/src/cat/cat.rs @@ -16,9 +16,9 @@ extern crate getopts; -use std::io::{print, File}; -use std::io::stdio::{stdout_raw, stdin_raw, stderr}; -use std::io::{IoResult}; +use std::old_io::{print, File}; +use std::old_io::stdio::{stdout_raw, stdin_raw, stderr}; +use std::old_io::{IoResult}; use std::ptr::{copy_nonoverlapping_memory}; pub fn uumain(args: Vec) -> isize { diff --git a/src/chmod/chmod.rs b/src/chmod/chmod.rs index c6b96d06f..735f4e77d 100644 --- a/src/chmod/chmod.rs +++ b/src/chmod/chmod.rs @@ -19,9 +19,9 @@ extern crate regex; #[plugin] #[no_link] extern crate regex_macros; use std::ffi::CString; -use std::io::fs; -use std::io::fs::PathExtensions; -use std::io::IoError; +use std::old_io::fs; +use std::old_io::fs::PathExtensions; +use std::old_io::IoError; use std::mem; use std::num::from_str_radix; use regex::Regex; diff --git a/src/chroot/chroot.rs b/src/chroot/chroot.rs index 1c9a67fb0..5f5cb88d9 100644 --- a/src/chroot/chroot.rs +++ b/src/chroot/chroot.rs @@ -17,7 +17,7 @@ use getopts::{optflag, optopt, getopts, usage}; use c_types::{get_pw_from_args, get_group}; use libc::funcs::posix88::unistd::{execvp, setuid, setgid}; use std::ffi::{c_str_to_bytes, CString}; -use std::io::fs::PathExtensions; +use std::old_io::fs::PathExtensions; use std::iter::FromIterator; #[path = "../common/util.rs"] #[macro_use] mod util; diff --git a/src/cksum/cksum.rs b/src/cksum/cksum.rs index 84fa903c5..7d9a7a875 100644 --- a/src/cksum/cksum.rs +++ b/src/cksum/cksum.rs @@ -12,8 +12,8 @@ extern crate getopts; -use std::io::{EndOfFile, File, IoError, IoResult, print}; -use std::io::stdio::stdin_raw; +use std::old_io::{EndOfFile, File, IoError, IoResult, print}; +use std::old_io::stdio::stdin_raw; use std::mem; use crc_table::CRC_TABLE; diff --git a/src/cksum/gen_table.rs b/src/cksum/gen_table.rs index f1ef74ed4..a436ce3f1 100644 --- a/src/cksum/gen_table.rs +++ b/src/cksum/gen_table.rs @@ -8,7 +8,7 @@ * file that was distributed with this source code. */ -use std::io; +use std::old_io as io; static CRC_TABLE_LEN: usize = 256; diff --git a/src/comm/comm.rs b/src/comm/comm.rs index aef40bbfb..154548333 100644 --- a/src/comm/comm.rs +++ b/src/comm/comm.rs @@ -13,9 +13,9 @@ extern crate getopts; use std::cmp::Ordering; -use std::io::{BufferedReader, IoResult, print}; -use std::io::fs::File; -use std::io::stdio::{stdin, StdinReader}; +use std::old_io::{BufferedReader, IoResult, print}; +use std::old_io::fs::File; +use std::old_io::stdio::{stdin, StdinReader}; use std::path::Path; static NAME : &'static str = "comm"; @@ -102,7 +102,7 @@ fn open_file(name: &str) -> IoResult { match name { "-" => Ok(LineReader::Stdin(stdin())), _ => { - let f = try!(std::io::File::open(&Path::new(name))); + let f = try!(std::old_io::File::open(&Path::new(name))); Ok(LineReader::FileIn(BufferedReader::new(f))) } } diff --git a/src/common/util.rs b/src/common/util.rs index 7ee97b5f2..89411e559 100644 --- a/src/common/util.rs +++ b/src/common/util.rs @@ -11,35 +11,35 @@ extern crate libc; macro_rules! show_error( ($($args:tt)+) => ({ - pipe_write!(&mut ::std::io::stderr(), "{}: error: ", ::NAME); - pipe_writeln!(&mut ::std::io::stderr(), $($args)+); + pipe_write!(&mut ::std::old_io::stderr(), "{}: error: ", ::NAME); + pipe_writeln!(&mut ::std::old_io::stderr(), $($args)+); }) ); #[macro_export] macro_rules! show_warning( ($($args:tt)+) => ({ - pipe_write!(&mut ::std::io::stderr(), "{}: warning: ", ::NAME); - pipe_writeln!(&mut ::std::io::stderr(), $($args)+); + pipe_write!(&mut ::std::old_io::stderr(), "{}: warning: ", ::NAME); + pipe_writeln!(&mut ::std::old_io::stderr(), $($args)+); }) ); #[macro_export] macro_rules! show_info( ($($args:tt)+) => ({ - pipe_write!(&mut ::std::io::stderr(), "{}: ", ::NAME); - pipe_writeln!(&mut ::std::io::stderr(), $($args)+); + pipe_write!(&mut ::std::old_io::stderr(), "{}: ", ::NAME); + pipe_writeln!(&mut ::std::old_io::stderr(), $($args)+); }) ); #[macro_export] macro_rules! eprint( - ($($args:tt)+) => (pipe_write!(&mut ::std::io::stderr(), $($args)+)) + ($($args:tt)+) => (pipe_write!(&mut ::std::old_io::stderr(), $($args)+)) ); #[macro_export] macro_rules! eprintln( - ($($args:tt)+) => (pipe_writeln!(&mut ::std::io::stderr(), $($args)+)) + ($($args:tt)+) => (pipe_writeln!(&mut ::std::old_io::stderr(), $($args)+)) ); #[macro_export] @@ -85,10 +85,10 @@ macro_rules! return_if_err( #[macro_export] macro_rules! pipe_print( ($($args:tt)+) => ( - match write!(&mut ::std::io::stdout(), $($args)+) { + match write!(&mut ::std::old_io::stdout(), $($args)+) { Ok(_) => true, Err(f) => { - if f.kind == ::std::io::BrokenPipe { + if f.kind == ::std::old_io::BrokenPipe { false } else { panic!("{}", f) @@ -101,10 +101,10 @@ macro_rules! pipe_print( #[macro_export] macro_rules! pipe_println( ($($args:tt)+) => ( - match writeln!(&mut ::std::io::stdout(), $($args)+) { + match writeln!(&mut ::std::old_io::stdout(), $($args)+) { Ok(_) => true, Err(f) => { - if f.kind == ::std::io::BrokenPipe { + if f.kind == ::std::old_io::BrokenPipe { false } else { panic!("{}", f) @@ -120,7 +120,7 @@ macro_rules! pipe_write( match write!($fd, $($args)+) { Ok(_) => true, Err(f) => { - if f.kind == ::std::io::BrokenPipe { + if f.kind == ::std::old_io::BrokenPipe { false } else { panic!("{}", f) @@ -136,7 +136,7 @@ macro_rules! pipe_writeln( match writeln!($fd, $($args)+) { Ok(_) => true, Err(f) => { - if f.kind == ::std::io::BrokenPipe { + if f.kind == ::std::old_io::BrokenPipe { false } else { panic!("{}", f) diff --git a/src/cp/cp.rs b/src/cp/cp.rs index cc177dfea..7c9188158 100644 --- a/src/cp/cp.rs +++ b/src/cp/cp.rs @@ -14,8 +14,8 @@ extern crate getopts; #[macro_use] extern crate log; use std::os; -use std::io; -use std::io::fs; +use std::old_io as io; +use std::old_io::fs; use getopts::{ getopts, diff --git a/src/cut/buffer.rs b/src/cut/buffer.rs index 1053c36c4..61c5f6ff4 100644 --- a/src/cut/buffer.rs +++ b/src/cut/buffer.rs @@ -1,5 +1,5 @@ use std; -use std::io::{IoResult, IoError}; +use std::old_io::{IoResult, IoError}; pub struct BufReader { reader: R, @@ -66,7 +66,7 @@ impl BufReader { loop { match self.maybe_fill_buf() { - Ok(0) | Err(IoError { kind: std::io::EndOfFile, .. }) + Ok(0) | Err(IoError { kind: std::old_io::EndOfFile, .. }) if self.start == self.end => return bytes_consumed, Err(err) => panic!("read error: {}", err.desc), _ => () @@ -93,7 +93,7 @@ impl BufReader { impl Bytes::Select for BufReader { fn select<'a>(&'a mut self, bytes: usize) -> Bytes::Selected<'a> { match self.maybe_fill_buf() { - Err(IoError { kind: std::io::EndOfFile, .. }) => (), + Err(IoError { kind: std::old_io::EndOfFile, .. }) => (), Err(err) => panic!("read error: {}", err.desc), _ => () } diff --git a/src/cut/cut.rs b/src/cut/cut.rs index 0d58d315d..396c81dba 100644 --- a/src/cut/cut.rs +++ b/src/cut/cut.rs @@ -13,8 +13,8 @@ extern crate getopts; extern crate libc; -use std::io::{stdio, File, BufferedWriter, BufferedReader, print}; -use std::io::fs::PathExtensions; +use std::old_io::{stdio, File, BufferedWriter, BufferedReader, print}; +use std::old_io::fs::PathExtensions; use getopts::{optopt, optflag, getopts, usage}; use ranges::Range; @@ -142,7 +142,7 @@ fn cut_characters(reader: R, 'newline: loop { let line = match buf_in.read_line() { Ok(line) => line, - Err(std::io::IoError { kind: std::io::EndOfFile, .. }) => break, + Err(std::old_io::IoError { kind: std::old_io::EndOfFile, .. }) => break, _ => panic!(), }; @@ -249,7 +249,7 @@ fn cut_fields_delimiter(reader: R, 'newline: loop { let line = match buf_in.read_until(b'\n') { Ok(line) => line, - Err(std::io::IoError { kind: std::io::EndOfFile, .. }) => break, + Err(std::old_io::IoError { kind: std::old_io::EndOfFile, .. }) => break, _ => panic!(), }; @@ -331,7 +331,7 @@ fn cut_fields(reader: R, 'newline: loop { let line = match buf_in.read_until(b'\n') { Ok(line) => line, - Err(std::io::IoError { kind: std::io::EndOfFile, .. }) => break, + Err(std::old_io::IoError { kind: std::old_io::EndOfFile, .. }) => break, _ => panic!(), }; diff --git a/src/dirname/dirname.rs b/src/dirname/dirname.rs index 56869fc80..26f898a2e 100644 --- a/src/dirname/dirname.rs +++ b/src/dirname/dirname.rs @@ -12,7 +12,7 @@ extern crate getopts; -use std::io::print; +use std::old_io::print; static VERSION: &'static str = "1.0.0"; diff --git a/src/du/du.rs b/src/du/du.rs index 740a82e31..bb37fcd39 100644 --- a/src/du/du.rs +++ b/src/du/du.rs @@ -16,7 +16,7 @@ extern crate getopts; extern crate libc; extern crate time; -use std::io::{stderr, fs, FileStat, FileType}; +use std::old_io::{stderr, fs, FileStat, FileType}; use std::num::Float; use std::option::Option; use std::path::Path; diff --git a/src/echo/echo.rs b/src/echo/echo.rs index 661162d7a..25975f828 100644 --- a/src/echo/echo.rs +++ b/src/echo/echo.rs @@ -13,7 +13,7 @@ extern crate getopts; extern crate libc; -use std::io::{print, println}; +use std::old_io::{print, println}; use std::num::from_str_radix; use std::str::from_utf8; diff --git a/src/env/env.rs b/src/env/env.rs index e27be6050..cb9559a50 100644 --- a/src/env/env.rs +++ b/src/env/env.rs @@ -192,13 +192,13 @@ pub fn uumain(args: Vec) -> isize { } if opts.program.len() >= 1 { - use std::io::process::{Command, InheritFd}; + use std::old_io::process::{Command, InheritFd}; let prog = opts.program[0].clone(); let args = &opts.program[1..]; match Command::new(prog).args(args).stdin(InheritFd(0)).stdout(InheritFd(1)).stderr(InheritFd(2)).status() { Ok(exit) => return match exit { - std::io::process::ExitStatus(s) => s, + std::old_io::process::ExitStatus(s) => s, _ => 1 }, Err(_) => return 1 diff --git a/src/expand/expand.rs b/src/expand/expand.rs index a1fcce9b9..70fc5c34d 100644 --- a/src/expand/expand.rs +++ b/src/expand/expand.rs @@ -15,7 +15,7 @@ extern crate getopts; extern crate libc; -use std::io; +use std::old_io as io; use std::str::StrExt; #[path = "../common/util.rs"] diff --git a/src/factor/factor.rs b/src/factor/factor.rs index 7581af446..80e1960a3 100644 --- a/src/factor/factor.rs +++ b/src/factor/factor.rs @@ -14,8 +14,8 @@ extern crate getopts; extern crate libc; use std::vec::Vec; -use std::io::BufferedReader; -use std::io::stdio::stdin_raw; +use std::old_io::BufferedReader; +use std::old_io::stdio::stdin_raw; #[path="../common/util.rs"] #[macro_use] diff --git a/src/fmt/fmt.rs b/src/fmt/fmt.rs index c6e42b89d..328f90693 100644 --- a/src/fmt/fmt.rs +++ b/src/fmt/fmt.rs @@ -17,8 +17,8 @@ extern crate getopts; extern crate unicode; use std::cmp; -use std::io::{BufferedReader, BufferedWriter, File, IoResult}; -use std::io::stdio::{stdin_raw, stdout_raw}; +use std::old_io::{BufferedReader, BufferedWriter, File, IoResult}; +use std::old_io::stdio::{stdin_raw, stdout_raw}; use linebreak::break_lines; use parasplit::ParagraphStream; diff --git a/src/fmt/parasplit.rs b/src/fmt/parasplit.rs index 0ea12aff1..901ec2f8f 100644 --- a/src/fmt/parasplit.rs +++ b/src/fmt/parasplit.rs @@ -8,7 +8,7 @@ */ use core::iter::Peekable; -use std::io::Lines; +use std::old_io::Lines; use std::slice::Iter; use std::str::CharRange; use unicode::str::UnicodeStr; diff --git a/src/fold/fold.rs b/src/fold/fold.rs index 39ac619e0..885a8ea98 100644 --- a/src/fold/fold.rs +++ b/src/fold/fold.rs @@ -13,9 +13,9 @@ extern crate getopts; extern crate libc; -use std::io; -use std::io::fs::File; -use std::io::BufferedReader; +use std::old_io; +use std::old_io::fs::File; +use std::old_io::BufferedReader; #[path = "../common/util.rs"] #[macro_use] diff --git a/src/hashsum/hashsum.rs b/src/hashsum/hashsum.rs index 258e4911f..83e847e5b 100644 --- a/src/hashsum/hashsum.rs +++ b/src/hashsum/hashsum.rs @@ -18,11 +18,11 @@ extern crate crypto; extern crate getopts; use std::ascii::AsciiExt; -use std::io::fs::File; -use std::io::stdio::stdin_raw; -use std::io::BufferedReader; -use std::io::IoError; -use std::io::EndOfFile; +use std::old_io::fs::File; +use std::old_io::stdio::stdin_raw; +use std::old_io::BufferedReader; +use std::old_io::IoError; +use std::old_io::EndOfFile; use regex::Regex; use crypto::digest::Digest; use crypto::md5::Md5; diff --git a/src/head/head.rs b/src/head/head.rs index 65c5e6286..33b56202a 100644 --- a/src/head/head.rs +++ b/src/head/head.rs @@ -15,9 +15,9 @@ extern crate getopts; use std::char::CharExt; -use std::io::{stdin}; -use std::io::{BufferedReader, BytesReader}; -use std::io::fs::File; +use std::old_io::{stdin}; +use std::old_io::{BufferedReader, BytesReader}; +use std::old_io::fs::File; use std::path::Path; use std::str::from_utf8; use getopts::{optopt, optflag, getopts, usage}; diff --git a/src/hostname/hostname.rs b/src/hostname/hostname.rs index 6c4539ffe..e7a2bbf3d 100644 --- a/src/hostname/hostname.rs +++ b/src/hostname/hostname.rs @@ -18,7 +18,7 @@ extern crate getopts; extern crate libc; use std::collections::hash_set::HashSet; -use std::io::net::addrinfo; +use std::old_io::net::addrinfo; use std::iter::repeat; use std::str; use getopts::{optflag, getopts, usage}; diff --git a/src/kill/kill.rs b/src/kill/kill.rs index cdcdcc9f1..d1b979544 100644 --- a/src/kill/kill.rs +++ b/src/kill/kill.rs @@ -18,7 +18,7 @@ extern crate serialize; #[macro_use] extern crate log; -use std::io::process::Process; +use std::old_io::process::Process; use getopts::{ getopts, diff --git a/src/link/link.rs b/src/link/link.rs index 633ee950d..a58e47921 100644 --- a/src/link/link.rs +++ b/src/link/link.rs @@ -12,7 +12,7 @@ extern crate getopts; -use std::io::fs::link; +use std::old_io::fs::link; use std::path::Path; #[path="../common/util.rs"] diff --git a/src/logname/logname.rs b/src/logname/logname.rs index ea5569f4f..b09859334 100644 --- a/src/logname/logname.rs +++ b/src/logname/logname.rs @@ -18,7 +18,7 @@ extern crate getopts; extern crate libc; use std::ffi::c_str_to_bytes; -use std::io::print; +use std::old_io::print; use libc::c_char; #[path = "../common/util.rs"] #[macro_use] mod util; diff --git a/src/mkdir/mkdir.rs b/src/mkdir/mkdir.rs index b3c84c8fc..67946aaf3 100644 --- a/src/mkdir/mkdir.rs +++ b/src/mkdir/mkdir.rs @@ -13,8 +13,8 @@ extern crate getopts; extern crate libc; -use std::io::fs::{self, PathExtensions}; -use std::io::FilePermission; +use std::old_io::fs::{self, PathExtensions}; +use std::old_io::FilePermission; use std::num::from_str_radix; #[path = "../common/util.rs"] diff --git a/src/mv/mv.rs b/src/mv/mv.rs index cff5af46c..8fad6d672 100644 --- a/src/mv/mv.rs +++ b/src/mv/mv.rs @@ -13,9 +13,9 @@ extern crate getopts; -use std::io::{BufferedReader, IoResult, fs}; -use std::io::stdio::stdin_raw; -use std::io::fs::PathExtensions; +use std::old_io::{BufferedReader, IoResult, fs}; +use std::old_io::stdio::stdin_raw; +use std::old_io::fs::PathExtensions; use std::path::GenericPath; use getopts::{ getopts, diff --git a/src/nice/nice.rs b/src/nice/nice.rs index 1e16f0c15..3ccdd82cb 100644 --- a/src/nice/nice.rs +++ b/src/nice/nice.rs @@ -14,7 +14,7 @@ extern crate getopts; extern crate libc; use std::ffi::CString; -use std::io::IoError; +use std::old_io::IoError; use std::os; use libc::{c_char, c_int, execvp}; diff --git a/src/nl/nl.rs b/src/nl/nl.rs index d39f77334..6fc6aea61 100644 --- a/src/nl/nl.rs +++ b/src/nl/nl.rs @@ -16,9 +16,9 @@ extern crate regex; extern crate getopts; -use std::io::{stdin}; -use std::io::BufferedReader; -use std::io::fs::File; +use std::old_io::{stdin}; +use std::old_io::BufferedReader; +use std::old_io::fs::File; use std::iter::repeat; use std::num::Int; use std::path::Path; diff --git a/src/nohup/nohup.rs b/src/nohup/nohup.rs index 25d4aca6d..ceb5f1819 100644 --- a/src/nohup/nohup.rs +++ b/src/nohup/nohup.rs @@ -15,8 +15,8 @@ extern crate libc; use getopts::{optflag, getopts, usage}; use std::ffi::CString; -use std::io::stdio::{stdin_raw, stdout_raw, stderr_raw}; -use std::io::{File, Open, Read, Append, Write}; +use std::old_io::stdio::{stdin_raw, stdout_raw, stderr_raw}; +use std::old_io::{File, Open, Read, Append, Write}; use std::os::unix::prelude::*; use libc::c_char; use libc::funcs::posix88::unistd::{dup2, execvp}; @@ -88,7 +88,7 @@ fn replace_fds() { } }; if unsafe { dup2(new_stdin.as_raw_fd(), 0) } != 0 { - crash!(2, "Cannot replace STDIN: {}", std::io::IoError::last_error()) + crash!(2, "Cannot replace STDIN: {}", std::old_io::IoError::last_error()) } } @@ -97,13 +97,13 @@ fn replace_fds() { let fd = new_stdout.as_raw_fd(); if unsafe { dup2(fd, 1) } != 1 { - crash!(2, "Cannot replace STDOUT: {}", std::io::IoError::last_error()) + crash!(2, "Cannot replace STDOUT: {}", std::old_io::IoError::last_error()) } } if replace_stderr { if unsafe { dup2(1, 2) } != 2 { - crash!(2, "Cannot replace STDERR: {}", std::io::IoError::last_error()) + crash!(2, "Cannot replace STDERR: {}", std::old_io::IoError::last_error()) } } } diff --git a/src/od/od.rs b/src/od/od.rs index fca7f2962..48ee18b4e 100644 --- a/src/od/od.rs +++ b/src/od/od.rs @@ -14,7 +14,7 @@ extern crate getopts; extern crate collections; use collections::string::String; -use std::io::File; +use std::old_io::File; #[derive(Show)] enum Radix { Decimal, Hexadecimal, Octal, Binary } diff --git a/src/paste/paste.rs b/src/paste/paste.rs index 980835fb4..a28538e75 100644 --- a/src/paste/paste.rs +++ b/src/paste/paste.rs @@ -13,7 +13,7 @@ extern crate getopts; extern crate libc; -use std::io; +use std::old_io as io; use std::iter::repeat; #[path = "../common/util.rs"] diff --git a/src/printenv/printenv.rs b/src/printenv/printenv.rs index c8108d177..99a57fec8 100644 --- a/src/printenv/printenv.rs +++ b/src/printenv/printenv.rs @@ -16,7 +16,7 @@ extern crate getopts; extern crate libc; use std::os; -use std::io::print; +use std::old_io::print; #[path = "../common/util.rs"] #[macro_use] diff --git a/src/pwd/pwd.rs b/src/pwd/pwd.rs index 15892c68c..0e2bffff3 100644 --- a/src/pwd/pwd.rs +++ b/src/pwd/pwd.rs @@ -13,7 +13,7 @@ extern crate getopts; extern crate libc; -use std::io::print; +use std::old_io::print; #[path = "../common/util.rs"] #[macro_use] diff --git a/src/readlink/readlink.rs b/src/readlink/readlink.rs index e0977d9d7..596c81930 100644 --- a/src/readlink/readlink.rs +++ b/src/readlink/readlink.rs @@ -13,8 +13,8 @@ extern crate getopts; use getopts::{optflag, getopts, usage, OptGroup}; -use std::io; -use std::io::fs; +use std::old_io as io; +use std::old_io::fs; use std::os; use std::vec::Vec; diff --git a/src/realpath/realpath.rs b/src/realpath/realpath.rs index 692a92b6a..8715e132d 100644 --- a/src/realpath/realpath.rs +++ b/src/realpath/realpath.rs @@ -87,12 +87,12 @@ fn resolve_path(path: &str, strip: bool, zero: bool, quiet: bool) -> bool { if !quiet { show_error!("Too many symbolic links: {}", path) }; return false } - match std::io::fs::lstat(&result) { + match std::old_io::fs::lstat(&result) { Err(_) => break, - Ok(ref s) if s.kind != std::io::FileType::Symlink => break, + Ok(ref s) if s.kind != std::old_io::FileType::Symlink => break, Ok(_) => { links_left -= 1; - match std::io::fs::readlink(&result) { + match std::old_io::fs::readlink(&result) { Ok(x) => { result.pop(); result.push(x); diff --git a/src/rm/rm.rs b/src/rm/rm.rs index 941fc1e66..c5f7a86c2 100644 --- a/src/rm/rm.rs +++ b/src/rm/rm.rs @@ -13,8 +13,8 @@ extern crate getopts; extern crate libc; -use std::io::{print, stdin, stdio, fs, BufferedReader}; -use std::io::fs::PathExtensions; +use std::old_io::{print, stdin, stdio, fs, BufferedReader}; +use std::old_io::fs::PathExtensions; #[path = "../common/util.rs"] #[macro_use] diff --git a/src/rmdir/rmdir.rs b/src/rmdir/rmdir.rs index 568a7fee3..852e8be27 100644 --- a/src/rmdir/rmdir.rs +++ b/src/rmdir/rmdir.rs @@ -13,8 +13,8 @@ extern crate getopts; extern crate libc; -use std::io::{print, fs}; -use std::io::fs::PathExtensions; +use std::old_io::{print, fs}; +use std::old_io::fs::PathExtensions; #[path = "../common/util.rs"] #[macro_use] diff --git a/src/shuf/shuf.rs b/src/shuf/shuf.rs index 82f2f795e..faf39e96f 100644 --- a/src/shuf/shuf.rs +++ b/src/shuf/shuf.rs @@ -14,8 +14,8 @@ extern crate getopts; extern crate libc; use std::cmp; -use std::io; -use std::io::IoResult; +use std::old_io as io; +use std::old_io::IoResult; use std::iter::{range_inclusive, RangeInclusive}; use std::rand::{self, Rng}; use std::usize; diff --git a/src/sleep/sleep.rs b/src/sleep/sleep.rs index c90112bfd..51964a6a1 100644 --- a/src/sleep/sleep.rs +++ b/src/sleep/sleep.rs @@ -14,7 +14,7 @@ extern crate getopts; extern crate libc; use std::f64; -use std::io::{print, timer}; +use std::old_io::{print, timer}; use std::time::duration::{self, Duration}; #[path = "../common/util.rs"] diff --git a/src/sort/sort.rs b/src/sort/sort.rs index 2e46bcd2d..46f495eb3 100644 --- a/src/sort/sort.rs +++ b/src/sort/sort.rs @@ -15,8 +15,8 @@ extern crate getopts; use std::cmp::Ordering; -use std::io::{print, File, BufferedReader}; -use std::io::stdio::stdin_raw; +use std::old_io::{print, File, BufferedReader}; +use std::old_io::stdio::stdin_raw; use std::str::Chars; #[path = "../common/util.rs"] diff --git a/src/split/split.rs b/src/split/split.rs index 218796e61..e9ca79659 100644 --- a/src/split/split.rs +++ b/src/split/split.rs @@ -13,7 +13,7 @@ extern crate getopts; extern crate libc; -use std::io; +use std::old_io as io; use std::num::Int; use std::char; diff --git a/src/stdbuf/stdbuf.rs b/src/stdbuf/stdbuf.rs index 4d56e078e..51b411d85 100644 --- a/src/stdbuf/stdbuf.rs +++ b/src/stdbuf/stdbuf.rs @@ -13,8 +13,8 @@ extern crate getopts; extern crate libc; use getopts::{optopt, optflag, getopts, usage, Matches, OptGroup}; -use std::io::process::{Command, StdioContainer, ProcessExit}; -use std::io::fs::PathExtensions; +use std::old_io::process::{Command, StdioContainer, ProcessExit}; +use std::old_io::fs::PathExtensions; use std::iter::range_inclusive; use std::num::Int; use std::os; diff --git a/src/sum/sum.rs b/src/sum/sum.rs index a51709e70..0c4539927 100644 --- a/src/sum/sum.rs +++ b/src/sum/sum.rs @@ -13,8 +13,8 @@ extern crate getopts; extern crate libc; -use std::io::{File, IoResult, print}; -use std::io::stdio::{stdin_raw}; +use std::old_io::{File, IoResult, print}; +use std::old_io::stdio::{stdin_raw}; #[path="../common/util.rs"] #[macro_use] diff --git a/src/tac/tac.rs b/src/tac/tac.rs index 2ae8771d5..61d58b352 100644 --- a/src/tac/tac.rs +++ b/src/tac/tac.rs @@ -13,7 +13,7 @@ extern crate getopts; extern crate libc; -use std::io; +use std::old_io as io; #[path = "../common/util.rs"] #[macro_use] diff --git a/src/tail/tail.rs b/src/tail/tail.rs index 02833c9fa..3f994ee1e 100644 --- a/src/tail/tail.rs +++ b/src/tail/tail.rs @@ -14,14 +14,14 @@ extern crate getopts; use std::char::CharExt; -use std::io::{stdin, stdout}; -use std::io::{BufferedReader, BytesReader}; -use std::io::fs::File; +use std::old_io::{stdin, stdout}; +use std::old_io::{BufferedReader, BytesReader}; +use std::old_io::fs::File; use std::path::Path; use std::str::from_utf8; use getopts::{optopt, optflag, getopts, usage}; use std::collections::ring_buf::RingBuf; -use std::io::timer::sleep; +use std::old_io::timer::sleep; use std::time::duration::Duration; #[path = "../common/util.rs"] diff --git a/src/tee/tee.rs b/src/tee/tee.rs index 98a6a0cb7..aa0dc5d99 100644 --- a/src/tee/tee.rs +++ b/src/tee/tee.rs @@ -13,9 +13,9 @@ extern crate getopts; #[macro_use] extern crate log; -use std::io::{println, stdin, stdout, Append, File, Truncate, Write}; -use std::io::{IoResult}; -use std::io::util::{copy, NullWriter, MultiWriter}; +use std::old_io::{println, stdin, stdout, Append, File, Truncate, Write}; +use std::old_io::{IoResult}; +use std::old_io::util::{copy, NullWriter, MultiWriter}; use std::os; use getopts::{getopts, optflag, usage}; diff --git a/src/test/test.rs b/src/test/test.rs index f7fd57179..91caba31f 100644 --- a/src/test/test.rs +++ b/src/test/test.rs @@ -382,8 +382,8 @@ fn path(path: &[u8], cond: PathCondition) -> bool { #[cfg(windows)] fn path(path: &[u8], cond: PathCondition) -> bool { - use std::io::{TypeFile, TypeDirectory, TypeBlockSpecial, TypeNamedPipe}; - use std::io::fs::{stat}; + use std::old_io::{TypeFile, TypeDirectory, TypeBlockSpecial, TypeNamedPipe}; + use std::old_io::fs::{stat}; use std::path::{Path}; let path = match Path::new_opt(path) { diff --git a/src/timeout/timeout.rs b/src/timeout/timeout.rs index de2589a1a..a2314cc2c 100644 --- a/src/timeout/timeout.rs +++ b/src/timeout/timeout.rs @@ -13,8 +13,8 @@ extern crate getopts; extern crate libc; -use std::io::{PathDoesntExist, FileNotFound}; -use std::io::process::{Command, ExitStatus, ExitSignal, InheritFd}; +use std::old_io::{PathDoesntExist, FileNotFound}; +use std::old_io::process::{Command, ExitStatus, ExitSignal, InheritFd}; #[path = "../common/util.rs"] #[macro_use] diff --git a/src/touch/touch.rs b/src/touch/touch.rs index 8b40d59fb..d99faee7b 100644 --- a/src/touch/touch.rs +++ b/src/touch/touch.rs @@ -13,8 +13,8 @@ extern crate getopts; extern crate time; -use std::io::File; -use std::io::fs::PathExtensions; +use std::old_io::File; +use std::old_io::fs::PathExtensions; #[path = "../common/util.rs"] #[macro_use] @@ -127,7 +127,7 @@ pub fn uumain(args: Vec) -> isize { } } - match std::io::fs::change_file_times(&path, atime, mtime) { + match std::old_io::fs::change_file_times(&path, atime, mtime) { Ok(t) => t, Err(e) => panic!("Unable to modify times\n{}", e.desc) } @@ -136,14 +136,14 @@ pub fn uumain(args: Vec) -> isize { 0 } -fn stat(path: &Path, follow: bool) -> std::io::FileStat { +fn stat(path: &Path, follow: bool) -> std::old_io::FileStat { if follow { - match std::io::fs::stat(path) { + match std::old_io::fs::stat(path) { Ok(stat) => stat, Err(e) => panic!("Unable to open file\n{}", e.desc) } } else { - match std::io::fs::lstat(path) { + match std::old_io::fs::lstat(path) { Ok(stat) => stat, Err(e) => panic!("Unable to open file\n{}", e.desc) } diff --git a/src/tr/tr.rs b/src/tr/tr.rs index da40f35f8..bd538690c 100644 --- a/src/tr/tr.rs +++ b/src/tr/tr.rs @@ -16,8 +16,8 @@ extern crate getopts; use getopts::OptGroup; use std::char::from_u32; use std::collections::{BitvSet, VecMap}; -use std::io::{BufferedReader, print}; -use std::io::stdio::{stdin_raw, stdout}; +use std::old_io::{BufferedReader, print}; +use std::old_io::stdio::{stdin_raw, stdout}; use std::iter::FromIterator; use std::vec::Vec; diff --git a/src/truncate/truncate.rs b/src/truncate/truncate.rs index aaecf8761..b02666f68 100644 --- a/src/truncate/truncate.rs +++ b/src/truncate/truncate.rs @@ -14,8 +14,8 @@ extern crate getopts; extern crate libc; use std::ascii::AsciiExt; -use std::io::{File, Open, ReadWrite, fs}; -use std::io::fs::PathExtensions; +use std::old_io::{File, Open, ReadWrite, fs}; +use std::old_io::fs::PathExtensions; #[path = "../common/util.rs"] #[macro_use] diff --git a/src/tsort/tsort.rs b/src/tsort/tsort.rs index 6ed75f64c..1f5a54009 100644 --- a/src/tsort/tsort.rs +++ b/src/tsort/tsort.rs @@ -14,7 +14,7 @@ extern crate getopts; extern crate libc; -use std::io; +use std::old_io as io; use std::collections::{HashSet, HashMap}; #[path = "../common/util.rs"] diff --git a/src/tty/tty.rs b/src/tty/tty.rs index 77fa59d34..6bee5b45c 100644 --- a/src/tty/tty.rs +++ b/src/tty/tty.rs @@ -18,8 +18,8 @@ extern crate getopts; extern crate libc; use std::ffi::c_str_to_bytes; -use std::io::println; -use std::io::stdio::stderr; +use std::old_io::println; +use std::old_io::stdio::stderr; use getopts::{optflag,getopts}; #[path = "../common/util.rs"] diff --git a/src/uname/uname.rs b/src/uname/uname.rs index 37a90350f..0c5b97a9d 100644 --- a/src/uname/uname.rs +++ b/src/uname/uname.rs @@ -19,7 +19,7 @@ extern crate libc; use std::ffi::c_str_to_bytes; use std::mem::uninitialized; -use std::io::print; +use std::old_io::print; use c_types::utsname; #[path = "../common/util.rs"] #[macro_use] mod util; diff --git a/src/unexpand/unexpand.rs b/src/unexpand/unexpand.rs index 8f6b97def..bcf743f00 100644 --- a/src/unexpand/unexpand.rs +++ b/src/unexpand/unexpand.rs @@ -13,7 +13,7 @@ extern crate getopts; extern crate libc; -use std::io; +use std::old_io as io; #[path = "../common/util.rs"] #[macro_use] diff --git a/src/uniq/uniq.rs b/src/uniq/uniq.rs index 65c7930d3..f0e31fce2 100644 --- a/src/uniq/uniq.rs +++ b/src/uniq/uniq.rs @@ -16,7 +16,7 @@ extern crate getopts; use std::ascii::OwnedAsciiExt; use std::cmp::min; use std::str::FromStr; -use std::io; +use std::old_io as io; #[path = "../common/util.rs"] #[macro_use] diff --git a/src/unlink/unlink.rs b/src/unlink/unlink.rs index 1ab563ce7..e01dc08c2 100644 --- a/src/unlink/unlink.rs +++ b/src/unlink/unlink.rs @@ -15,9 +15,9 @@ extern crate getopts; extern crate libc; -use std::io; -use std::io::fs::{self, PathExtensions}; -use std::io::print; +use std::old_io as io; +use std::old_io::fs::{self, PathExtensions}; +use std::old_io::print; #[path = "../common/util.rs"] #[macro_use] diff --git a/src/uptime/uptime.rs b/src/uptime/uptime.rs index c10f67e31..ca0cb645e 100644 --- a/src/uptime/uptime.rs +++ b/src/uptime/uptime.rs @@ -20,7 +20,7 @@ extern crate "time" as rtime; use std::ffi::CString; use std::mem::transmute; -use std::io::{print, File}; +use std::old_io::{print, File}; use std::ptr::null; use libc::{time_t, c_double, c_int, c_char}; use utmpx::*; diff --git a/src/users/users.rs b/src/users/users.rs index 03878656e..3287a6877 100644 --- a/src/users/users.rs +++ b/src/users/users.rs @@ -19,7 +19,7 @@ extern crate getopts; extern crate libc; use std::ffi::{CString, c_str_to_bytes}; -use std::io::print; +use std::old_io::print; use std::mem; use std::ptr; use utmpx::*; diff --git a/src/wc/wc.rs b/src/wc/wc.rs index 904c3c020..a88fcc52a 100644 --- a/src/wc/wc.rs +++ b/src/wc/wc.rs @@ -15,9 +15,9 @@ extern crate libc; use std::ascii::AsciiExt; use std::str::from_utf8; -use std::io::{print, File, BufferedReader}; -use std::io::fs::PathExtensions; -use std::io::stdio::stdin_raw; +use std::old_io::{print, File, BufferedReader}; +use std::old_io::fs::PathExtensions; +use std::old_io::stdio::stdin_raw; use std::result::Result as StdResult; use std::borrow::IntoCow; use getopts::Matches; diff --git a/src/whoami/whoami.rs b/src/whoami/whoami.rs index e9827a623..927547697 100644 --- a/src/whoami/whoami.rs +++ b/src/whoami/whoami.rs @@ -17,7 +17,7 @@ extern crate getopts; extern crate libc; -use std::io::print; +use std::old_io::print; #[path = "../common/util.rs"] #[macro_use] mod util; diff --git a/src/yes/yes.rs b/src/yes/yes.rs index 8a265fc06..ae41cdc7d 100644 --- a/src/yes/yes.rs +++ b/src/yes/yes.rs @@ -15,7 +15,7 @@ extern crate getopts; extern crate libc; -use std::io::print; +use std::old_io::print; use std::borrow::IntoCow; #[path = "../common/util.rs"] diff --git a/test/cat.rs b/test/cat.rs index b82c45abe..afa185d9d 100644 --- a/test/cat.rs +++ b/test/cat.rs @@ -1,6 +1,6 @@ #![allow(unstable)] -use std::io::process::Command; +use std::old_io::process::Command; use std::str; static PROGNAME: &'static str = "./cat"; diff --git a/test/cp.rs b/test/cp.rs index 6a9478cc9..6becd0c9f 100644 --- a/test/cp.rs +++ b/test/cp.rs @@ -1,8 +1,8 @@ #![allow(unstable)] -use std::io::process::Command; -use std::io::File; -use std::io::fs::{unlink, PathExtensions}; +use std::old_io::process::Command; +use std::old_io::File; +use std::old_io::fs::{unlink, PathExtensions}; static EXE: &'static str = "./cp"; static TEST_HELLO_WORLD_SOURCE: &'static str = "hello_world.txt"; diff --git a/test/mkdir.rs b/test/mkdir.rs index 527fa6b45..1c54deb2f 100644 --- a/test/mkdir.rs +++ b/test/mkdir.rs @@ -1,7 +1,7 @@ #![allow(unstable)] -use std::io::process::Command; -use std::io::fs::{rmdir, PathExtensions}; +use std::old_io::process::Command; +use std::old_io::fs::{rmdir, PathExtensions}; use std::borrow::ToOwned; static EXE: &'static str = "./mkdir"; diff --git a/test/mv.rs b/test/mv.rs index 6dddb4c7f..4c5eadb15 100644 --- a/test/mv.rs +++ b/test/mv.rs @@ -2,9 +2,9 @@ extern crate time; -use std::io::{process, fs, FilePermission}; -use std::io::process::Command; -use std::io::fs::PathExtensions; +use std::old_io::{process, fs, FilePermission}; +use std::old_io::process::Command; +use std::old_io::fs::PathExtensions; use std::str::from_utf8; use std::borrow::ToOwned; diff --git a/test/nl.rs b/test/nl.rs index 61e3c3b78..556d96fa9 100644 --- a/test/nl.rs +++ b/test/nl.rs @@ -1,6 +1,6 @@ #![allow(unstable)] -use std::io::process::Command; +use std::old_io::process::Command; use std::str; static PROGNAME: &'static str = "./nl"; diff --git a/test/seq.rs b/test/seq.rs index 3dce8cc52..605e7397d 100644 --- a/test/seq.rs +++ b/test/seq.rs @@ -1,6 +1,6 @@ #![allow(unstable)] -use std::io::process::Command; +use std::old_io::process::Command; use std::str; static PROGNAME: &'static str = "./seq"; diff --git a/test/sort.rs b/test/sort.rs index 3aa69c8ac..32cf7c046 100644 --- a/test/sort.rs +++ b/test/sort.rs @@ -1,7 +1,7 @@ #![allow(unstable)] -use std::io::process::Command; -use std::io::File; +use std::old_io::process::Command; +use std::old_io::File; use std::string::String; static PROGNAME: &'static str = "./sort"; diff --git a/test/test.rs b/test/test.rs index c1fe3536f..480d0aa3f 100644 --- a/test/test.rs +++ b/test/test.rs @@ -1,6 +1,6 @@ #![allow(unstable)] -use std::io::process::Command; +use std::old_io::process::Command; static EXE: &'static str = "./test"; diff --git a/test/tr.rs b/test/tr.rs index 7c792ec06..0ebe0f948 100644 --- a/test/tr.rs +++ b/test/tr.rs @@ -1,6 +1,6 @@ #![allow(unstable)] -use std::io::process::Command; +use std::old_io::process::Command; static PROGNAME: &'static str = "./tr"; diff --git a/test/truncate.rs b/test/truncate.rs index b61c50a1e..aaea87593 100644 --- a/test/truncate.rs +++ b/test/truncate.rs @@ -1,7 +1,7 @@ #![allow(unstable)] -use std::io; -use std::io::process::Command; +use std::old_io as io; +use std::old_io::process::Command; static PROGNAME: &'static str = "./truncate"; static TFILE1: &'static str = "truncate_test_1"; diff --git a/test/unexpand.rs b/test/unexpand.rs index 94ac39f31..92377fad2 100644 --- a/test/unexpand.rs +++ b/test/unexpand.rs @@ -1,6 +1,6 @@ #![allow(unstable)] -use std::io::process::Command; +use std::old_io::process::Command; static PROGNAME: &'static str = "./unexpand";