This project contains a file system watcher class. The class can watch a single directory or a directory tree for selected changes. Class files can be included, linked via SLL's, or used from a DLL. DLL is included in the zip file. Simple examples for PBCC 6 and PBWin 10 are included.To start watching the following lines may be used:
You can watch for any of the following: LOCAL fsw AS iFilesystemWatcher
CALL StartFilesystemWatcher( fsw, "c:\test\", CODEPTR( OnChange ), %fsWatchFor.ALL, 1 )
Notice of selected changes are sent to a notifcation function with the following signature:ENUM fsWatchFor
Filename = &H1
DirectoryName = &H2
Attributes = &H4
Size = &H8
Write = &H10
Access = &H20
Creation = &H40
Security = &H100
All = &H17f
END ENUM
A changeEvent can have one of the following values:SUB OnChange( filename AS WSTRING, BYVAL changeEvent AS LONG )
' Your code here
END SUB
ENUM fsEvent
Added = 1
Removed = 2
Modified = 3
OldName = 4
NewName = 5
END ENUM