0

I have a main configuration file config.yml.

In it, I would like to specify list of 'included' config files. The includes can be resolved using search patterns, which include wild cards.

For example:

includes: - /plugins/**/config.yml - /etc/**/config.yml 

Currently, the only way to search for files in .net is by calling Directory.GetFile, but this method has to receive explicitly SearchOption whether to include all subdirectories or only the top one in the search.

It doesn't support "search all sub directories" (/**/) pattern.

Is there any simple way to achieve this?

2
  • 1
    The file pattern is called a “glob”. I would look into glob libraries that can do what you want. To my knowledge there is no such functionality in the core libraries. Commented Jun 2, 2019 at 8:35
  • I would accept it as an answer Commented Jun 2, 2019 at 8:42

1 Answer 1

1

The file pattern is called a “glob”. To my knowledge there is no functionality in the core libraries to handle globs. I would look for a third-party glob library.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.