PeanutButter
Loading...
Searching...
No Matches
PeanutButter.Utils.SafeWalk Class Reference

Utility class to provide the ability to enumerate files without throwing exceptions on access errors. More...

Static Public Member Functions

static IEnumerable< string > EnumerateFiles (string path, string searchPattern, SearchOption searchOpt)
 mostly lifted from http://stackoverflow.com/questions/5098011/directory-enumeratefiles-unauthorizedaccessexception

Detailed Description

Utility class to provide the ability to enumerate files without throwing exceptions on access errors.

Member Function Documentation

◆ EnumerateFiles()

IEnumerable< string > PeanutButter.Utils.SafeWalk.EnumerateFiles ( string path,
string searchPattern,
SearchOption searchOpt )
static

mostly lifted from http://stackoverflow.com/questions/5098011/directory-enumeratefiles-unauthorizedaccessexception

Parameters
pathBase path to start the search from
searchPatternFilename pattern to match for result files
searchOptWhether to search just the given base folder or recurse down the path tree
Returns
A collection of strings which are the found file paths. May be empty, will not throw, even on access errors.

The documentation for this class was generated from the following file:
  • source/Utils/PeanutButter.Utils/SafeWalk.cs