Is there a fast way to locate a file if I only know its name and not its path? Some time ago I wrote a program that does a recursive directory search of all of a PC's hard drives that does just that, but it's slow.
Printable View
Is there a fast way to locate a file if I only know its name and not its path? Some time ago I wrote a program that does a recursive directory search of all of a PC's hard drives that does just that, but it's slow.
Welcome to the wonderful world of Microsoft and the FAT table. :D
There is no way to be able to find a file quicker unless you had a process that collected the names of all files into a database, updated them regularly and stored them in a B-Treive structure.
In their infinite wisdom and a desire to always have everything "Backwards Compatible" Microsoft have stupidly kept a flat and sequential file structure that has to be traversed from beginning to end to find what you are looking for.
The Machintosh however, in their infinite inginuity started using B-trieve file structures way back in the 80's and have never looked back... searching for a file by name on a Machintosh never takes more than 5 seconds REGARDLESS how big the hard drive is or how many files are on there because it is basically traversing a global file index (much like the primary index of a database) and only needs to make 4-5 passes to get the answer it wants.
Sorry to have disappointed you ;)
Maybe this helps
http://www.mvps.org/vbnet/code/filea...searchinfo.htm
But it never gets fast ;(