BBjFileSystem::watchDirectory
Description
In BBj 17.0 and higher, this method watches the specified directory for changes (create, modify, delete), periodically reporting any changes through the specified callback.
Syntax
Return Value |
Method |
String |
watchDirectory(String directory, string label) |
String |
watchDirectory(String directory, UserObject obj, string methodName) |
Parameters
Variable |
Description |
directory |
The directory to be watched. |
label |
The subroutine to be invoked to report any directory changes. |
obj |
A UserObject containing the method to be called to report any directory changes. |
methodName |
The name of the method that is to be called to report any directory changes. |
Return Value
Returns the full directory path.
Remarks
When registering a UserObject method as the target of the callback, the method must conform to the following constraints:
-
The method must be declared as public with a return type of void.
-
The method must accept a single parameter.
The type of the method parameter must be either BBjDirectoryChangeEvent or BBjEvent or Object.
To stop watching a directory, see unwatchDirectory or unwatchAllDirectories.
Example
|
See Also
BBjFileSystem::unwatchDirectory
BBjFileSystem::unwatchAllDirectories
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.