I'd like to start a discussion on including a file system globbing API in .NET (Core). If you look at implementations mentioned on Wikipedia, every "mainstream platform" has an entry, but not .NET.
There's quite a few (more or less) successful implementations around (see below), some even from Microsoft, but I think something as fundamental as this, should ship with the framework.
There's already partial globbing support using the following methods
Directory.GetFiles
Directory.EnumerateFiles
Directory.GetFileSystemEntries
Directory.EnumerateFileSystemEntries
Directory.GetDirectories
Directory.EnumerateDirectories
They all have a searchPattern argument, but it lacks support for recursive globs (** aka. "globstar"), brace expansion etc. This can be achieved using the SearchOption argument, but the API is hard to use when you want to support (often user-defined) recursive patterns like /src/**/*.csproj.
I'd ❤️ to hear people's opinions here...
- Is it worth including in the framework?
- Should new APIs be introduced, or can we "level up" the existing
searchPattern in the methods mentioned above (without it being a breaking change)?
Examples
And tons of other implementations...
I'd like to start a discussion on including a file system globbing API in .NET (Core). If you look at implementations mentioned on Wikipedia, every "mainstream platform" has an entry, but not .NET.
There's quite a few (more or less) successful implementations around (see below), some even from Microsoft, but I think something as fundamental as this, should ship with the framework.
There's already partial globbing support using the following methods
Directory.GetFilesDirectory.EnumerateFilesDirectory.GetFileSystemEntriesDirectory.EnumerateFileSystemEntriesDirectory.GetDirectoriesDirectory.EnumerateDirectoriesThey all have a
searchPatternargument, but it lacks support for recursive globs (**aka. "globstar"), brace expansion etc. This can be achieved using theSearchOptionargument, but the API is hard to use when you want to support (often user-defined) recursive patterns like/src/**/*.csproj.I'd ❤️ to hear people's opinions here...
searchPatternin the methods mentioned above (without it being a breaking change)?Examples
And tons of other implementations...