We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
!is_dir
is_file
1 parent 50c0192 commit 93cbad6Copy full SHA for 93cbad6
src/libstd/fs.rs
@@ -1307,6 +1307,12 @@ impl FileType {
1307
/// [`is_dir`] and [`is_symlink`]; only zero or one of these
1308
/// tests may pass.
1309
///
1310
+ /// This property means it is often more useful to use `!file_type.is_dir()`
1311
+ /// than `file_type.is_file()` when your goal is to read bytes from a
1312
+ /// source: the former includes symlink and pipes when the latter does not,
1313
+ /// meaning you will break workflows like `diff <( prog_a ) <( prog_b )` on
1314
+ /// a Unix-like system for example.
1315
+ ///
1316
/// [`is_dir`]: struct.FileType.html#method.is_dir
1317
/// [`is_symlink`]: struct.FileType.html#method.is_symlink
1318
0 commit comments