Python Script Engine
7.0
GL Studio Editor Python Script API
|
Public Types | |
enum | ChangeType { CHANGED, DELETED } |
Public Member Functions | |
unsigned int | Register (String pathName, PyObject *pyfunc, bool requireExclusiveLock=false) |
void | Unregister (unsigned int id) |
Module Methods | |
FileMonitor * | GetFileMonitor () |
Common editor interface for the FileMonitor.
unsigned int Register | ( | String | pathName, |
PyObject * | pyfunc, | ||
bool | requireExclusiveLock = false |
||
) |
Register a file name to watch.
pathName | the path to the file to watch |
pyfunc | the python function to call when the file is changed. It takes 2 parameters 1) the ID of the registration 2) the change type enum (CHANGED or DELETED in ChangeType) |
requireExclusiveLock | When True, once a change (not deletion) is detected, the FileMonitor will wait until it can get an exclusive read lock on the file before calling pyfunc. If the time elapsed since the change was detected is greater than 10 mins, the change is discarded. The default is False (non-exclusive), which calls the callback immediately when a change is detected. |
void Unregister | ( | unsigned int | id | ) |
Remove a previously registered file.
id | The identifier returned by Register(). If the ID is invalid or not present, this function has no effect. |
CEIException& |
|
friend |
Gets the file monitor.