multidiskscanner TdcMultiDiskScanner component
Properties Methods Events Example See also
Return to Introduction  Previous page  Next page
Overview
The dcMultiDiskScanner component is enhancement of the dcDiskScanner component Able to search files in multiple locations with multiple searching masks. MultiDiskScanner operates with two lists — IncludeList and ExcludeList that describes desired and unwanted searching paths and file masks.  
For example, you would like to find all files in the "c:\windows\" directory, including all subfolders except "c:\windows\system". Just put the "c:\windows\*.*" path to the IncludeList, point that this path should include subfolders, and put "c:\windows\systems\*.*" to the ExcludeList.  

How to use ?
Just set the search rules, what folders and / or search masks you would like to include (IncludeList) and which to exclude (ExcludeList) and call the Execute method to start find files in many specified locations. Found files will returned by OnFileFound event.  
 
You can set the including rules either at design and run-time of your application.  
 
new! dcMultiDiskScanner now supports UNC names and can search files in local network. To search network files you should specify '\\?\' prefix in the search path. For example, or example, "\\?\C:\myworld\private" is seen as "C:\myworld\private" (will search files in local machine), and "\\?\UNC\bill_g_1\hotstuff\coolapps" is seen as "\\bill_g_1\hotstuff\coolapps" (search files in bill_g_1 machine, at "hotsfull\coolaps" folder, if it is shared).  

How does it works ?
Once you call the Execute method, the MultiDiskScanner starts new searching thread. Scanning process separated on two stages:  
 
Stage 1: Excluding  
First of all, MultiDiskScanner should determinate all files and directories that does not satisfy to the searching rules, for further excluding them from the search results. When component starts handling of ExcludeListOnExcludingBegin event occurs. When component done all excludings and ready to find files by criterias specified in IncludeListOnExcludingEnd occurs.  
 
Stage 2: Searching  
After completion of first, excluding stage, MultiDIskScanner scans all locations specified in the IncludeList. When it found the file, and this file is not previously excluded from search results — OnFileFound event occurs. When it passes to another folder — OnScanFolder event occurs. When scanning is complete — OnScanDone occurs.  

See also
dcDiskScanner component.