Skip to content

Rephrase fs::symlink_metadata error #85

@marcospb19

Description

@marcospb19

This is 100% a nitpicky ask but I got this error message:

failed to query metadata of symlink `/tmp/ ... 

It was a call to fs_err::symlink_metadata.

fs-err/src/errors.rs

Lines 96 to 98 in 62640b6

E::SymlinkMetadata => {
write!(formatter, "failed to query metadata of symlink `{}`", path)
}

I think it should have the same error message as the regular metadata call.

E::Metadata => write!(formatter, "failed to query metadata of file `{}`", path),


I know symlink_metadata makes it sound like it's supposed to refer to reading a symlink, like read_link.

But that method actually exists so that we can check file metadata without traversing symlinks, it is a different behavior, but it doesn't imply that the given path is actually a symlink.

You might just want to check for file types, but you want 3 options instead of just 2, without really expecting that file to be a symlink.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions