.net with FileInfo for large files

I am trying to get the file size of large files (some are over 1 gigabyte) using FileInfo. It works but takes about 20 seconds. Actually all I need is to find out if the file is of a certain size, for example 100mb. Is there a faster way to do this?

New System.IO.FileInfo(ProcessPath).Length

      

Edit: BTW, the file I'm using for testing is a 1.6 gigabyte executable installer. So my guess is that every file in the installer is readable and that is why it takes so long. Is there a way to disable the timeout after 5 seconds or so, since if it takes more than 5 seconds we can safely assume it's a large file?

+3


source to share


1 answer


To rebuild the Windows search index, go back to Control Panel> Indexing Options. Click the Advanced button and make sure you are on the Index Options tab of the Advanced Options options



http://www.tekrevue.com/tip/how-to-solve-windows-search-issues-index-rebuild/

0


source







All Articles