Unit TDirScan

Classes

TDirectoryScan -

Functions

Register - function FindFirst32(DirFilePath: PChar): integer; {Encapsulate the call

Types

TDirectoryFound
TFileFound
TFileType
TFileTypeSet
TVerifyFile

Constants

Variables


Functions


procedure Register;

function FindFirst32(DirFilePath: PChar): integer; {Encapsulate the call

Types


TDirectoryFound =  procedure(Sender: TObject; Pathname: string) of Object

TFileFound =  procedure(Sender: TObject; Filename: string) of Object

TFileType = (ftHidden , ftSystem, ftArchive, ftReadOnly);

TFileTypeSet = set of TFileType

TVerifyFile = procedure(Sender: TObject; Path: string;
													stream: TFileStream;TimeStamp: TDateTime;
													var PassFlag: Boolean) of Object
TDirectoryScan A Delphi - compatible VCL control which encapsulates the recursive scanning of file system directories in Win16 or Win32 file systems. An original work, Copyright 1997 by Donald L. Wallace. The right is granted to use this source code in any software program as long as this copyright notice and these comments are included with the source code or any source code derived from this file. No warranty of fitness for any purpose is provided. Use at your own risk. Author Email address: 71247.3221@Compuserve.com Updated 01 July 1997 by Brian Lowe of Beond Technology Corp. Changes: 1. Added Busy property 2. Removed recursion from directory scan algorithm with my string list technique: * Add initial search path spec to Paths TStringList * Start search * If a file is found, process it. * If a directory is found, add it to the end of the Paths list. * When current directory has been searched, remove its entry from the beginning of the Paths list. * When Paths list is empty, search is complete. This algorithm is copyright ©1993 - 1997 Brian A. Lowe, Jr. All rights reserved. 3. Added FileNameMatch routine to allow * and ? wild card searches. Updated August 8 - 15, 1997. by Brian Lowe of Beond Technology Corp. 1. Removed OnDirList event as I could not figure out a purpose for it. 2. Moved FOnFileFound and FOnDirectoryFound calls directly into FindFirst/FindNext loop to eliminate 2 needless function calls. 3. Added code to allow long file name usage if Kernel32 can be loaded. This uses Call32NT.Pas and LongName.Pas, public domain code written by others which uses Win95 flat thunking to call into Kernel32 functions. The primary calls used are FindFirstFile/FindNextFile. Thanks guys! 4. Modified FileNameMatch to work with long file names - anything up to the last period is considered the filename prefix. Anything after the last period is considered the extension. Asterisk matches an extension of any length, otherwise extension length and extension spec must be the same length. Updated September 11, 1997. by Brian Lowe of Beond Technology Corp. 1. Fixed a bug in which FTotalCount was not being incremented, thus causing Result of DoSearch16 and DoSearch32 to be wrong. 2. Removed minimally useful CurDirectory and TotalCount properties.

Constants


Variables