www.icetips.com  Icetips Utilities Documentation 11/14/2010    

File Search Class:  ResetFileCounters

Previous  Top  Next  


Prototype: (<String pDirectory>)

 

[pDirectory]Optional parameter which specifies directory to reset counters for.  If omitted, file counters for all directories are set to zero.

 

This method is called from CountFilesInDirectories and is used to reset the file counters for either the specified pDirectory directory or all directories in the Directories property queue to zero.  This would be called before repeated calls to ScanFiles in case the file numbers have changed.  An example could be some sort of file monitoring system that monitored the number of files in folders.  Before repeatedly calling ScanFiles you should call ResetFileCounters() as otherwise ScanFiles will accumulate the number of files.  Without the call to ResetFileCounters() in the example below, the ITF.Directories.FileCounter for each folder would double in the second call to the ScanFiles method.

 

Example:

ITF  ITFileSearchClass

Code

ITF.ScanDirectories('C:\Temp')

ITF.ScanFiles(,,,True)   !! Count files

ITF.ResetFileCounters()  !! Reset
ITF.ScanFiles(,,,True)   !! Count files again

 

 

See also:

ScanDirectories

ScanFiles

Directories



Direct link to this page: http://www.icetips.com/manuals/utilities/resetfilecounters_filesearch.htm