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

Public Types

enum  ChangeType {

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.


The watched file was changed.


The watched file was deleted.

Member Function Documentation

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

Register a file name to watch.

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.
The ID of this registration.
void Unregister ( unsigned int  id)

Remove a previously registered file.

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

Friends And Related Function Documentation

FileMonitor GetFileMonitor ( )

Gets the file monitor.

file monitor

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