Skip to content

fs::FileType and Metadata should document that is_file, is_dir, and is_symlink are mutually exclusive. #48345

Closed
@ExpHP

Description

@ExpHP

fs::FileType should document that is_file(), is_dir(), and is_symlink() are all mutually exclusive. (and that it may also be the case that none of them are true)

Why? Because Path::is_file() returns true for both files and symlinks to files, and this tends to make me paranoid that a fs::FileType will share similar characteristics and perhaps claim that both x.is_file() and x.is_symlink(). The only way to convince myself that FileType's behavior is indeed sane is to write a little test program---again.

Surely I can't be alone in this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions