TFindFile v2.21
---------------

Author: Kambiz R. Khojasteh
Email: khojasteh@www.dci.co.ir
Web: http://www.crosswinds.net/~khojasteh/


TFindFile is a non-visual component for D1, D3, D4, and D5 (may be worked on D2 and
C++Builder but I am not sure). Drop this component on the form; fill some properties, 
then write a very simple event handler. Finally, call execute. Component begins the 
search and fires the event every time it finds a file.


P R O P E R T I E S
-------------------

* Filename: String
  Specifies the name of the file that you want to find. This name can be containing
  wildcards. When IncludeFiles property is set, TFindFile ignores this property.

* Location: String
  Determines the folder (directory) or folders that you want to begin the search there.
  To specify multiple folders, separate folders with semicolon. When IncludeFiles 
  property is set, TFindFile ignores this property.

* Subfolders: Boolean
  If set to true, all subfolders of the specified location(s) will be searched.

* IncludeFiles: TStringList
  Determines list of files that you want to find. File names can contain wildcards and
  should have contain drive and path. When this property is set, TFindFile ignores 
  Filename and Location properties.
  
* ExcludeFiles: TStringList
  Determines list of files that must be ignored in search result. Files in this list can 
  contain wildcards.

  Example:
 
     *.txt		// Ignores all text files in any folder and drive
     C:\*.txt		// Ignores all text files in root of drive C:
     ?:\*.txt		// Ignores all text files in root of any drive
     C:lib\*.txt	// Ignores all text files in lib subfolder of any folder of drive C:
     lib\*.txt		// Ignores all text files in lib subfolder in any folder and drive
     C:\lib\*.txt	// Ignores all text files in lib subfolder of root of drive C:
     ?:\lib\*.txt	// Ignores all text files in lib subfolder of root of any drive

* Attributes: TFileAttributes
  TFileAttribute = (ffArchive, ffReadonly, ffHidden, ffSystem, ffDirectory);
  TFileAttributes = set of TFileAttribute;
  Determines desired attributes for the target file(s).
    ffArchive   - Archive files are acceptable
    ffReadonly  - Read-only files are acceptable
    ffHidden    - Hidden files are acceptable
    ffSystem    - System files are acceptable
    ffDirectory - Directories are acceptable
  When Attributes property set to empty set [], it means normal attribute.

* ExactAttribute: Boolean
  If set to true, file will be accepted if its attributes are equal to selected attributes.

  Example

  Attributes := [ffReadonly, ffHidden];
  ExactAttribute := False;
  
  TFindFile finds files by Readonly OR Hidden attribute bit set.

  Attributes := [ffReadonly, ffHidden];
  ExactAttribute := True;
  
  TFindFile finds files by Readonly AND Hidden attribute bit set.


* Containing: String;
  Specifies the text that file must contain it. Set this property to empty string if you 
  do not need this option.

* IgnoreCase: Boolean;
  If sets to true, the component ignores case of letters in search for file containing
  text.

* SizeMin: LongInt;
  Determines the lower range of file size. Set this property to zero if you do not
  need this criteria.

* SizeMax: LongInt;
  Determines the upper range of file size. Set this property to zero if you do not
  need this criteria.

* CreatedAfter: TDateTime; (Win32 Only)
  Determines the lower range of file creation date and time. To ignore lower date 
  criteria, set date part to zero and to ignore lower time criteria, set time part to 
  zero.

* CreatedBefore: TDateTime; (Win32 Only)
  Determines the upper range of file creation date and time. To ignore upper date 
  criteria, set date part to zero and to ignore upper time criteria, set time part to 
  zero.

* ModifiedAfter: TDateTime;
  Determines the lower range of file last write date and time. To ignore lower date 
  criteria, set date part to zero and to ignore lower time criteria, set time part to 
  zero.

* ModifiedBefore: TDateTime; 
  Determines the upper range of file last write date and time. To ignore upper date 
  criteria, set date part to zero and to ignore upper time criteria, set time part to 
  zero.

* AccessedAfter: TDateTime; (Win32 Only)
  Determines the lower range of file last access date and time. To ignore lower date 
  criteria, set date part to zero and to ignore lower time criteria, set time part to 
  zero.

* AccessedBefore: TDateTime; (Win32 Only)
  Determines the upper range of file last access date and time. To ignore upper date 
  criteria, set date part to zero and to ignore upper time criteria, set time part to 
  zero.

* Aborted: Boolean (Read-only)
  If set to true indicates the last attempt of search has been aborted.

* Busy: Boolean (Read-only)
  If set to true indicates the component is searching.

* Threaded: Boolean (Win32 Only)
  If set to true, search begins in a separate thread.

* ThreadPriority: TThreadPriority (Win32 Only)
  Determines priority of the thread for threaded searches.


M E T H O D S
-------------

* procedure Execute;
  This method begins the search. For each found file, an event will be fired.

* procedure Abort;
  Aborts the running search and sets the aborted property to true.


E V E N T S
-----------

* OnFound: TFoundEvent
  TFoundEvent = procedure (Sender: TObject; Folder: String;
    var FileInfo: TSearchRec) of object;
  This event will be fired when a file matches with the search criteria.
  "Folder" specifies the location of the found file and "FileInfo" contains
  the file information (Name, Size, Time, Attr, and...).

* OnNewFolder: TFoundEvent
  TNewFolderEvent = procedure (Sender: TObject; Folder: String;
    var IgnoreFolder: Boolean) of object;
  This event helps you to monitor the current search location and will be
  triggered when component begins to search in a new folder. To bypass a
  folder, set "IgnoreFolder" to True.

* OnComplete: TNotifyEvent
  This event is just triggered when search is completed or aborted.


H I S T O R Y
-------------

* Version 2.21 - 16 Apr 2000
  - a minor bug fixed.

* Version 2.2 - 15 Apr 2000
  - Reported bugs fixed.

* Version 2.11 - 20 Mar 2000
  - On previous version, TFindFile ignores files with normal attribute. In this 
    version the bug has been fixed.

* Version 2.1 - 18 Mar 2000
  - Two new properties IncludeFiles and ExcludeFiles added to the component.

* Version 2.0 - 25 Feb 2000
  - ffNormal was a meaningless attribute and removed. When no any attribute 
    is selected, it means Normal.
  - Files can be found by spcifiying the range of file size, file creation 
    date and time, file last write date and time, file last acccess date and 
    time, and containing text. 
  - Component improved to accept all or any of selected attributes for the file. 
  - Search location can contain multiple folders. 

* Version 1.1 - 1 Feb 2000
  - Threaded property added. This means the component can search for file(s) in a
    separate thread.
  - ThreadPriority and Busy properties added.
  - OnComplete event added

* Version 1.0 - 14 Jan 2000
  - Initial release


D I S C L A I M E R
-------------------

TFindFile component is freeware. You may copy component's files AS LONG AS YOU COPY 
ALL OF THEM. If you want to change the source code in order to improve the component's 
features, performance, etc. please send me the new source code so that I can have 
a look at it. The changed source code should contain descriptions what you have 
changed, and of course your name. The only thing you MAY NOT CHANGE is the ORIGINAL 
COPYRIGHT INFORMATION. 
The author is NOT liable for any DAMAGES resulting from the use and misuse of the 
component, especially he is NOT liable for DAMAGES that were caused BY ANY VERSION 
WHICH HAS NOT BEEN PROGRAMMED BY THE AUTHOR HIMSELF.


If you have any suggestions or bug reports about this component, feel free to mail me.

Kambiz
