• Home
  • Raw
  • Download

Lines Matching +full:check +full:- +full:examples

5 Most uses of this crate should be limited to the top-level [`is_same_file`]
13 # fn try_main() -> Result<(), Box<Error>> {
24 equality check depending on your access pattern. For example, if one wanted to
25 check whether any path in a list of paths corresponded to the process' stdout
26 handle, then one could build a handle once for stdout. The equality check for
34 # fn try_main() -> Result<(), Box<Error>> {
36 "examples/is_same_file.rs",
37 "examples/is_stderr.rs",
38 "examples/stderr",
57 See [`examples/is_stderr.rs`] for a runnable example and compare the output of:
59 - `cargo run --example is_stderr 2> examples/stderr` and
60 - `cargo run --example is_stderr`.
64 [`examples/is_stderr.rs`]: https://github.com/BurntSushi/same-file/blob/master/examples/is_same_fil…
96 /// will compare not-equal.
104 /// *don't* point to the same file. Check the [source] for specific
107 /// [source]: https://github.com/BurntSushi/same-file/tree/master/src
114 /// Note that the underlying [`File`] is opened in read-only mode on all
117 /// [`File`]: https://doc.rust-lang.org/std/fs/struct.File.html
125 /// [`io::Error`]: https://doc.rust-lang.org/std/io/struct.Error.html
127 /// # Examples
128 /// Check that two paths are not the same file:
134 /// # fn try_main() -> Result<(), Box<Error>> {
145 pub fn from_path<P: AsRef<Path>>(p: P) -> io::Result<Handle> { in from_path()
155 /// [`io::Error`]: https://doc.rust-lang.org/std/io/struct.Error.html
156 /// [`File`]: https://doc.rust-lang.org/std/fs/struct.File.html
158 /// # Examples
159 /// Check that two files are not in fact the same file:
166 /// # fn try_main() -> Result<(), Box<Error>> {
182 pub fn from_file(file: File) -> io::Result<Handle> { in from_file()
190 /// be opened due to any I/O-related reason.
192 /// [`io::Error`]: https://doc.rust-lang.org/std/io/struct.Error.html
194 /// # Examples
200 /// # fn try_main() -> Result<(), Box<Error>> {
248 pub fn stdin() -> io::Result<Handle> { in stdin()
256 /// be opened due to any I/O-related reason.
258 /// [`io::Error`]: https://doc.rust-lang.org/std/io/struct.Error.html
260 /// # Examples
264 pub fn stdout() -> io::Result<Handle> { in stdout()
272 /// be opened due to any I/O-related reason.
274 /// [`io::Error`]: https://doc.rust-lang.org/std/io/struct.Error.html
276 /// # Examples
280 pub fn stderr() -> io::Result<Handle> { in stderr()
286 /// # Examples
297 /// # fn try_main() -> Result<(), Box<Error>> {
320 pub fn as_file(&self) -> &File { in as_file()
326 /// # Examples
330 pub fn as_file_mut(&mut self) -> &mut File { in as_file_mut()
338 pub fn dev(&self) -> u64 { in dev()
346 pub fn ino(&self) -> u64 { in ino()
361 /// [`io::Error`]: https://doc.rust-lang.org/std/io/struct.Error.html
370 pub fn is_same_file<P, Q>(path1: P, path2: Q) -> io::Result<bool> in is_same_file()
391 /// Create an error from a format!-like syntax.
415 fn new() -> Result<TempDir> { in new()
428 let path = tmpdir.join("rust-walkdir").join(count.to_string()); in new()
441 fn path(&self) -> &Path { in path()
446 fn tmpdir() -> TempDir { in tmpdir()
454 ) -> io::Result<()> { in soft_link_dir()
463 ) -> io::Result<()> { in soft_link_file()
471 ) -> io::Result<()> { in soft_link_dir()
480 ) -> io::Result<()> { in soft_link_file()
491 // Alas, I don't know how to create those environmental conditions. ---AG