diff --git a/src/cp/cp.rs b/src/cp/cp.rs index b3d7a5184..d6d216579 100644 --- a/src/cp/cp.rs +++ b/src/cp/cp.rs @@ -1,5 +1,5 @@ #![crate_name = "cp"] -#![feature(path_ext)] +#![feature(fs_canonicalize)] /* * This file is part of the uutils coreutils package. @@ -155,8 +155,8 @@ fn copy(matches: getopts::Matches) { pub fn paths_refer_to_same_file(p1: &Path, p2: &Path) -> Result { // We have to take symlinks and relative paths into account. - let pathbuf1 = try!(p1.canonicalize()); - let pathbuf2 = try!(p2.canonicalize()); + let pathbuf1 = try!(fs::canonicalize(p1)); + let pathbuf2 = try!(fs::canonicalize(p2)); Ok(pathbuf1 == pathbuf2) } diff --git a/src/realpath/realpath.rs b/src/realpath/realpath.rs index c0db15f09..19e41456c 100644 --- a/src/realpath/realpath.rs +++ b/src/realpath/realpath.rs @@ -1,5 +1,5 @@ #![crate_name= "realpath"] -#![feature(path_ext)] +#![feature(fs_canonicalize)] /* * This file is part of the uutils coreutils package. @@ -13,7 +13,7 @@ extern crate getopts; extern crate libc; -use std::fs::PathExt; +use std::fs; use std::io::Write; use std::path::{Path, PathBuf}; @@ -63,7 +63,7 @@ pub fn uumain(args: Vec) -> i32 { fn resolve_path(path: &str, strip: bool, zero: bool, quiet: bool) -> bool { let p = Path::new(path).to_path_buf(); - let abs = p.canonicalize().unwrap(); + let abs = fs::canonicalize(p).unwrap(); if strip { if zero { diff --git a/src/relpath/relpath.rs b/src/relpath/relpath.rs index 2775799a6..e02f16e56 100644 --- a/src/relpath/relpath.rs +++ b/src/relpath/relpath.rs @@ -1,5 +1,5 @@ #![crate_name = "relpath"] -#![feature(path_ext)] +#![feature(fs_canonicalize)] /* * This file is part of the uutils coreutils package. @@ -14,7 +14,7 @@ extern crate getopts; extern crate libc; use std::env; -use std::fs::PathExt; +use std::fs; use std::io::Write; use std::path::{Path, PathBuf}; @@ -54,12 +54,12 @@ pub fn uumain(args: Vec) -> i32 { } else { env::current_dir().unwrap() }; - let absto = to.canonicalize().unwrap(); - let absfrom = from.canonicalize().unwrap(); + let absto = fs::canonicalize(to).unwrap(); + let absfrom = fs::canonicalize(from).unwrap(); if matches.opt_present("d") { let base = Path::new(&matches.opt_str("d").unwrap()).to_path_buf(); - let absbase = base.canonicalize().unwrap(); + let absbase = fs::canonicalize(base).unwrap(); if !absto.as_path().starts_with(absbase.as_path()) || !absfrom.as_path().starts_with(absbase.as_path()) { println!("{}", absto.display()); return 0 diff --git a/src/stdbuf/stdbuf.rs b/src/stdbuf/stdbuf.rs index 8db5685b5..f8a1dff9d 100644 --- a/src/stdbuf/stdbuf.rs +++ b/src/stdbuf/stdbuf.rs @@ -1,5 +1,5 @@ #![crate_name = "stdbuf"] -#![feature(negate_unsigned, path_ext)] +#![feature(fs_canonicalize, negate_unsigned)] /* * This file is part of the uutils coreutils package. @@ -15,7 +15,7 @@ extern crate libc; use getopts::{Matches, Options}; use std::env; -use std::fs::PathExt; +use std::fs; use std::io::{self, Write}; use std::os::unix::process::ExitStatusExt; use std::path::PathBuf; @@ -195,7 +195,7 @@ fn set_command_env(command: &mut Command, buffer_name: &str, buffer_type: Buffer fn exe_path() -> io::Result { let exe_path = try!(env::current_exe()); - let absolute_path = try!(exe_path.as_path().canonicalize()); + let absolute_path = try!(fs::canonicalize(exe_path.as_path())); Ok(match absolute_path.parent() { Some(p) => p.to_path_buf(), None => absolute_path.clone()