question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A file which matches the pattern in multiple ways is returned multiple times

See original GitHub issue

Suppose I have the following file: C:\files\a\a\a\b.txt When I use the following code: string[] matchingFiles = Glob.Files(@"C:\files", "**/a/**/b.txt").ToArray(); matchingFiles result is:

[0] = a\a\a\b.txt
[1] = a\a\a\b.txt
[2] = a\a\a\b.txt

When I add another a\ subfolder, it gets another item added etc.

Is this by design? I would rather get distinct values.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kthompsoncommented, Jul 3, 2020

Fixed in version 1.1.7

0reactions
ffMathycommented, Jun 27, 2020

How about just using a HashSet<string> to store the paths? That way, duplicates won’t be stored, and it’s O(1) insertion time complexity (almost no cost).

Read more comments on GitHub >

github_iconTop Results From Across the Web

grep multiple patterns and print results with the match pattern
grep will output the file name and the full line containing your pattern. If you only want to display the pattern that was...
Read more >
Using find to locate files that match one of multiple patterns
I was trying to get a list of all python and html files in a directory with the command find Documents -name "*.{py,html}"...
Read more >
How to Grep for Multiple Strings, Patterns or Words
Use grep to search for multiple patterns or words in a file by following examples in this guide. The grep tool is one...
Read more >
Using Grep & Regular Expressions to Search for Text ...
Grep is a tool used to search for specified patterns within text input using regular expressions. Regular expressions are a system for ...
Read more >
How to search multiple Words, Strings, Patterns with grep
Grep for multiple patterns to search through a list of strings / words through a files under Linux, macOS, *BSD or UNIX bash/ksh...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found