Python Script Engine  7.1
GL Studio Editor Python Script API
FileMonitor Class Reference

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

Methods that can be called on the module.

FileMonitorGetFileMonitor ()
 

Detailed Description

Common editor interface for the FileMonitor.

Member Enumeration Documentation

What the change type a callback was received as.

Enumerator
CHANGED 

The watched file was changed.

DELETED 

The watched file was deleted.

Member Function Documentation

unsigned int Register ( String  pathName,
PyObject *  pyfunc,
bool  requireExclusiveLock = false 
)

Register a file name to watch.

Parameters
pathNamethe path to the file to watch
pyfuncthe 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)
requireExclusiveLockWhen 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.
Returns
The ID of this registration.
void Unregister ( unsigned int  id)

Remove a previously registered file.

Parameters
idThe identifier returned by Register(). If the ID is invalid or not present, this function has no effect.
Exceptions
CEIException&

Friends And Related Function Documentation

FileMonitor GetFileMonitor ( )
friend

Gets the file monitor.

Returns
file monitor

The documentation for this class was generated from the following file: