| Python Script Engine 8.3 GL Studio Editor Python Script API

Public Types | Public Member Functions | List of all members
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.
FileMonitor * | GetFileMonitor ()

## Detailed Description

Common editor interface for the FileMonitor.

## Member Enumeration Documentation

## ◆ ChangeType

enum FileMonitor::ChangeType

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

## ◆ Register()

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

Register a file name to watch.

Parameters

  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.

Returns
  The ID of this registration.

## ◆ Unregister()

void Unregister | ( | unsigned int | id | ) |

Remove a previously registered file.

Parameters

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

Exceptions

  CEIException& |

## Friends And Related Function Documentation

## ◆ GetFileMonitor

FileMonitor GetFileMonitor | ( |  | ) |
| friend

Gets the file monitor.

Returns
  file monitor

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

- FileMonitor.i