• Home
  • Raw
  • Download

Lines Matching +full:path +full:- +full:exists

1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
15 use std::path::Path;
31 fn exists(&self) -> bool; in exists() method
32 fn is_dir(&self) -> bool; in is_dir()
35 impl PathExt for Path { implementation
36 fn exists(&self) -> bool { in exists() method
39 fn is_dir(&self) -> bool { in is_dir()
45 let path = { in test_tempdir() localVariable
46 let p = t!(Builder::new().prefix("foobar").tempdir_in(&Path::new("."))); in test_tempdir()
47 let p = p.path(); in test_tempdir()
51 assert!(!path.exists()); in test_tempdir()
62 let name = tmpfile.path().file_name().unwrap().to_str().unwrap(); in test_customnamed()
70 let f = move || -> () { in test_rm_tempdir()
72 tx.send(tmp.path().to_path_buf()).unwrap(); in test_rm_tempdir()
76 let path = rx.recv().unwrap(); in test_rm_tempdir() localVariable
77 assert!(!path.exists()); in test_rm_tempdir()
80 let path = tmp.path().to_path_buf(); in test_rm_tempdir() localVariable
81 let f = move || -> () { in test_rm_tempdir()
86 assert!(!path.exists()); in test_rm_tempdir()
88 let path; in test_rm_tempdir() localVariable
93 path = tmp.path().to_path_buf(); in test_rm_tempdir()
94 assert!(path.exists()); in test_rm_tempdir()
96 assert!(!path.exists()); in test_rm_tempdir()
98 let path; in test_rm_tempdir() localVariable
101 path = tmp.into_path(); in test_rm_tempdir()
103 assert!(path.exists()); in test_rm_tempdir()
104 t!(fs::remove_dir_all(&path)); in test_rm_tempdir()
105 assert!(!path.exists()); in test_rm_tempdir()
110 let f = move || -> () { in test_rm_tempdir_close()
112 tx.send(tmp.path().to_path_buf()).unwrap(); in test_rm_tempdir_close()
117 let path = rx.recv().unwrap(); in test_rm_tempdir_close() localVariable
118 assert!(!path.exists()); in test_rm_tempdir_close()
121 let path = tmp.path().to_path_buf(); in test_rm_tempdir_close() localVariable
122 let f = move || -> () { in test_rm_tempdir_close()
128 assert!(!path.exists()); in test_rm_tempdir_close()
130 let path; in test_rm_tempdir_close() localVariable
135 path = tmp.path().to_path_buf(); in test_rm_tempdir_close()
136 assert!(path.exists()); in test_rm_tempdir_close()
139 assert!(!path.exists()); in test_rm_tempdir_close()
141 let path; in test_rm_tempdir_close() localVariable
144 path = tmp.into_path(); in test_rm_tempdir_close()
146 assert!(path.exists()); in test_rm_tempdir_close()
147 t!(fs::remove_dir_all(&path)); in test_rm_tempdir_close()
148 assert!(!path.exists()); in test_rm_tempdir_close()
154 let path = Path::new("frob"); in recursive_mkdir_rel() localVariable
158 path.display(), in recursive_mkdir_rel()
160 path.exists() in recursive_mkdir_rel()
162 t!(fs::create_dir(&path)); in recursive_mkdir_rel()
163 assert!(path.is_dir()); in recursive_mkdir_rel()
164 t!(fs::create_dir_all(&path)); in recursive_mkdir_rel()
165 assert!(path.is_dir()); in recursive_mkdir_rel()
169 let dot = Path::new("."); in recursive_mkdir_dot()
171 let dotdot = Path::new(".."); in recursive_mkdir_dot()
176 let path = Path::new("./frob/baz"); in recursive_mkdir_rel_2() localVariable
180 path.display(), in recursive_mkdir_rel_2()
182 path.exists() in recursive_mkdir_rel_2()
184 t!(fs::create_dir_all(&path)); in recursive_mkdir_rel_2()
185 assert!(path.is_dir()); in recursive_mkdir_rel_2()
186 assert!(path.parent().unwrap().is_dir()); in recursive_mkdir_rel_2()
187 let path2 = Path::new("quux/blat"); in recursive_mkdir_rel_2()
202 let tmpdir = tmpdir.path(); in test_remove_dir_all_ok()
211 assert!(!root.exists()); in test_remove_dir_all_ok()
212 assert!(!root.join("bar").exists()); in test_remove_dir_all_ok()
213 assert!(!root.join("bar").join("blat").exists()); in test_remove_dir_all_ok()
221 t!(fs::remove_dir(tmpdir.path())); in dont_double_panic()
235 assert!(env::set_current_dir(tmpdir.path()).is_ok()); in in_tmpdir()
244 fn takes_asref_path<T: AsRef<Path>>(path: T) { in pass_as_asref_path()
245 let path = path.as_ref(); in pass_as_asref_path() localVariable
246 assert!(path.exists()); in pass_as_asref_path()