type PDirChange = ^TDirChange;
TOnDirChange = procedure (Sender: PDirChange; const Path: KOLString) of object;
Event type to define OnChange event for folder monitoring objects.
TFileChangeFilters = (fncFileName, fncDirName, fncAttributes, fncSize, fncLastWrite, fncLastAccess, fncCreation, fncSecurity);
Possible change monitor filters.
TFileChangeFilter = set of TFileChangeFilters;
Set of filters to pass to a constructor of TDirChange object.
TDirChange = object(TObj)
Object type to monitor changes in certain folder.
TDirChange Properties
Handle of file change notification object.
property Path: KOLString;
Path to monitored folder (to a root, if tree of folders is under monitoring).
property OnChange: TOnDirChange;
function NewDirChangeNotifier( const Path: KOLString; Filter: TFileChangeFilter; WatchSubtree: Boolean; ChangeProc: TOnDirChange; OnExecuteProc: TOnEvent) : PDirChange;
Creates notification object TDirChange. If something wrong (e.g., passed directory does not exist), nil is returned as a result. When change is notified, ChangeProc is called always in main thread context.
(Please note, that ChangeProc can not be nil).
If empty filter is passed, default filter is used: [fncFileName..fncLastWrite].