Skip to content

Broken symlinks are ignored #104

Closed
@rileysu

Description

@rileysu

running this code snippet prints nothing:

  for entry in glob::glob("src/test-link").unwrap() {
      println!("{:?}", entry);
  }

given that test-link is a broken symlink:

touch test-file
ln -s test-file test-link
rm test-file

This can possibly be fixed by changing fs::metadata(&next_path).is_ok() to (fs::metadata(&next_path).is_ok() || fs::symlink_metadata(&next_path).is_ok()) on this line:
https://github.com/rust-lang-nursery/glob/blob/337d417ee872dc04e8e6faff4b7379141933df59/src/lib.rs#L857

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions