C# Forms App Query file system

FreedomIT
FreedomIT used Ask the Experts™
on
Here is my issue,
I have a program that is going through a file system and moving directories and zipping them up then clearing them out. that works fine my issue is that the files system is huge! 300,000+ directories. I want to be able to query all of these files for a specified file creation date range but do not want to have to loop through each individual file to check the date. Thanks in advance
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2010

Commented:

See if this codeproject code helps you. It provides a FastDirectoryEnumerator.EnumerateFiles method. It says it uses the internal win32 apis FindFirstFile/FindNextFile in enumerator to avoid the overheads in c#'s Directory.GetFiles method.. ==> http://www.codeproject.com/KB/files/FastDirectoryEnumerator.aspx

Author

Commented:
tried that but it did not seem to work it caused a systemstacklockout

Commented:
Maybe you can add the FileInfo object for each file to a DataTable. With a DataView you can filter the DataTable comfortable. This is just an idea, i didn't try it, but i know the "DataView-Filter" is very good.
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

I ended up using streams to fix this thanks

Author

Commented:
solved

Commented:
=> "I ended up using streams to fix this thanks"
What did you do? Could you maybe give us a short explaination?

Thank you,
samml

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial