Open TylerLeonhardt opened 5 years ago
I think that if you do a recursive search, you should not be blocked by the files that you don't have access to, they should be only ignored.
The problem with the current code is here, EnumerateFileSystemInfos(string, SearchOption)
does not support ignoring inaccessible files:
https://github.com/dotnet/runtime/blob/3cf8d43713c6ee188486459d988db0af0d7596c6/src/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Abstractions/DirectoryInfoWrapper.cs#L38
The scenario could be easily enable if we could use the EnumerateFileSystemInfos
overload that takes EnumerableOptions
and then you pass options with IgnoreInaccessible
set to true
. The concern is that such API is not available for NS2.0 which is the version that FileSystemGlobbing targets.
cc @carlossanlop @maryamariyan
Yeah my product is a NS2.0 lib as well so I would appreciate the support there :)
+1 on this issue
Describe the bug
I'm receiving a
System.UnauthorizedAccessException
while using theMicrosoft.Extensions.FileSystemGlobbing
. I need some way to catch this exception and continue the File search.To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect some way to catch these errors and continue searching.
Additional context
Include the output of
dotnet --info
: