about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAlexis Bourget <alexis.bourget@gmail.com>2020-06-11 18:15:57 +0200
committerAlexis Bourget <alexis.bourget@gmail.com>2020-06-11 18:15:57 +0200
commitec63f9d99b4faec04db0f924c24be9529f4febed (patch)
treee4c327b8a9238d44aba7ca762ce5e7a907ca0d33 /src/libstd
parent93cbad6ed5f6a40bdd1e8cee6a9b1a39f17ab166 (diff)
downloadrust-ec63f9d99b4faec04db0f924c24be9529f4febed.tar.gz
rust-ec63f9d99b4faec04db0f924c24be9529f4febed.zip
Added the note to Metadata too
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/fs.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs
index c2bea8d9d63..a9c481dfb80 100644
--- a/src/libstd/fs.rs
+++ b/src/libstd/fs.rs
@@ -1033,6 +1033,12 @@ impl Metadata {
     /// [`is_dir`], and will be false for symlink metadata
     /// obtained from [`symlink_metadata`].
     ///
+    /// This property means it is often more useful to use `!file_type.is_dir()`
+    /// than `file_type.is_file()` when your goal is to read bytes from a
+    /// source: the former includes symlink and pipes when the latter does not,
+    /// meaning you will break workflows like `diff <( prog_a ) <( prog_b )` on
+    /// a Unix-like system for example.
+    ///
     /// [`is_dir`]: struct.Metadata.html#method.is_dir
     /// [`symlink_metadata`]: fn.symlink_metadata.html
     ///