0

Python's glob module lets you search for files matching a particular pattern. For example glob.glob("*.jpg") would list all jpegs in the working directory.

A more complex example using the double asterisk ** syntax to search all subfolders of 'pics' for cat photos:

glob.glob("pics/**/*cat*.jpg", recursive=True)

Is there any similar function in .NET?

Colonel Panic
  • 126,394
  • 80
  • 383
  • 450

1 Answers1

0

Directory.GetFiles is possibly a closest that comes to mind. However you can use only standard Windows wildcards (pretty sure that ** functionality is not supported). However you can filter results after you get them if that is tolerable solution.

Petr Abdulin
  • 32,124
  • 8
  • 59
  • 93