Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat is the fastest way to get lists of files and search through file lists repeatedly?
    primarykey
    data
    text
    <p>What is the fastest way to get lists of files and search through file lists repeatedly?</p> <p>Situation:</p> <ol> <li>There can be 5,000 to 35,000 files spread over 3-5 root directories (that have many subdirectories) on a network drive.</li> <li>There are three file types (tif, sus, img) that a user may or may not search for. Some file types can have 2-3 different file extensions.</li> <li>From a list of files (in various database tables), I need to find out if each file exists, and if it does, save the path only and filename only to a table.</li> <li>Searches on file names must be case sensitive but it would be nice to keep original case when saving the path to the table.</li> </ol> <p>Environment:</p> <p>C# and .NET 4.0 on Windows PC.</p> <p>Is this the fastest way?:</p> <p>Is the fastest way to use a dictionary, with FileName as a key (lowercase) and Path as a value (original case)? In this way I can get the index/Path at the same pass when I search for the filename? The FileName and Path are split up front when populating the list.</p> <pre><code>if (d.TryGetValue("key", out value)) { // Log "key" and value to table // only does one lookup } </code></pre> <p>Note: I am a bit concerned that I probably will have duplicate key values per FileType. When/If I run across this scenario what type of list and access method should I use?</p> <p>Maybe on these rare cases, I should populate another list of the duplicate keys. Because I will need to do at least one of: log/copy/delete of the files in any path.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload