When searching for files in a directory tree ( Folder and all sub-folders), what is the effective difference between doing this:
Directory.GetFiles(root, "*", SearchOption.AllDirectories);
and doing your own recursive search using
Directory.GetFiles(root) and Directory.GetDirectories(root)
What are the pros and cons for using each method, which method is suited for which use case? Thanks.
The main reason you might want to 'roll your own' recursion in this case could be that you want to be able to set up custom progress updating / notification to users during a long file search.
This isn't possible if you hand everything over to the framework method from the start.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With