2 Checks for `FileType::is_file()`.
5 When people testing a file type with `FileType::is_file`
6 they are testing whether a path is something they can get bytes from. But
7 `is_file` doesn't cover special file types in unix-like systems, and doesn't cover
8 symlink in windows. Using `!FileType::is_dir()` is a better way to that intention.
12 let metadata = std::fs::metadata("foo.txt")?;
13 let filetype = metadata.file_type();
15 if filetype.is_file() {
23 let metadata = std::fs::metadata("foo.txt")?;
24 let filetype = metadata.file_type();
26 if !filetype.is_dir() {