How to get list of files / folders as IEnumerable and not an array
how to get list of files / folders as IEnumerable and not array?
the reason I want to do this is to have many folders with 20,000+ files in them, and I need to skip all of them, but don't want to wait for them to compile into an array. but just want to go through one at a time.
Also I am using .net 3.5 not v4
+2
a source to share
2 answers
Too bad you're not on .net 4 - it looks like they added this functionality .
Also, I can't provide any code as I have no experience with this, but perhaps P / Invoke wraps some C code using FindFirstFile / FindNextFile ?
EDIT: A little googling has turned up some code in the Code Project .
+6
a source to share