Module pyinotify :: Class EventsCodes
[hide private]
[frames] | no frames]

Class EventsCodes

source code


Set of codes corresponding to each kind of events. Some of these flags are used to communicate with inotify, whereas the others are sent to userspace by inotify notifying some events.

Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
str
maskname(mask)
Returns the event name associated to mask.
source code
Class Variables [hide private]
  FLAG_COLLECTIONS = {'EVENT_FLAGS': {'IN_IGNORED': 32768, 'IN_Q...
  ALL_FLAGS = {'ALL_EVENTS': 4095, 'IN_ACCESS': 1, 'IN_ATTRIB': ...
  ALL_VALUES = {1: 'IN_ACCESS', 2: 'IN_MODIFY', 4: 'IN_ATTRIB', ...
int ALL_EVENTS
Alias for considering all of the events.
  EVENT_FLAGS = {'IN_IGNORED': 32768, 'IN_Q_OVERFLOW': 16384, 'I...
int IN_ACCESS
File was accessed.
int IN_ATTRIB
Metadata changed.
int IN_CLOSE_NOWRITE
Unwrittable file closed.
int IN_CLOSE_WRITE
Writtable file was closed.
int IN_CREATE
Subfile was created.
int IN_DELETE
Subfile was deleted.
int IN_DELETE_SELF
Self (watched item itself) was deleted.
int IN_DONT_FOLLOW
don't follow a symlink (new in kernel 2.6.15).
int IN_EXCL_UNLINK
Events are not generated for children after they have been unlinked from the watched directory.
int IN_IGNORED
File was ignored.
int IN_ISDIR
Event occurred against dir.
int IN_MASK_ADD
add to the mask of an already existing watch (new in kernel 2.6.14).
int IN_MODIFY
File was modified.
int IN_MOVED_FROM
File was moved from X.
int IN_MOVED_TO
File was moved to Y.
int IN_MOVE_SELF
Self (watched item itself) was moved.
int IN_ONESHOT
Only send event once.
int IN_ONLYDIR
only watch the path if it is a directory (new in kernel 2.6.15).
int IN_OPEN
File was opened.
int IN_Q_OVERFLOW
Event queued overflowed.
int IN_UNMOUNT
Backing fs was unmounted.
  OP_FLAGS = {'IN_ACCESS': 1, 'IN_ATTRIB': 4, 'IN_CLOSE_NOWRITE'...
  SPECIAL_FLAGS = {'IN_DONT_FOLLOW': 33554432, 'IN_EXCL_UNLINK':...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

maskname(mask)
Static Method

source code 

Returns the event name associated to mask. IN_ISDIR is appended to the result when appropriate. Note: only one event is returned, because only one event can be raised at a given time.

Parameters:
  • mask (int) - mask.
Returns: str
event name.

Class Variable Details [hide private]

FLAG_COLLECTIONS

Value:
{'EVENT_FLAGS': {'IN_IGNORED': 32768,
                 'IN_Q_OVERFLOW': 16384,
                 'IN_UNMOUNT': 8192},
 'OP_FLAGS': {'IN_ACCESS': 1,
              'IN_ATTRIB': 4,
              'IN_CLOSE_NOWRITE': 16,
              'IN_CLOSE_WRITE': 8,
              'IN_CREATE': 256,
...

ALL_FLAGS

Value:
{'ALL_EVENTS': 4095,
 'IN_ACCESS': 1,
 'IN_ATTRIB': 4,
 'IN_CLOSE_NOWRITE': 16,
 'IN_CLOSE_WRITE': 8,
 'IN_CREATE': 256,
 'IN_DELETE': 512,
 'IN_DELETE_SELF': 1024,
...

ALL_VALUES

Value:
{1: 'IN_ACCESS',
 2: 'IN_MODIFY',
 4: 'IN_ATTRIB',
 8: 'IN_CLOSE_WRITE',
 16: 'IN_CLOSE_NOWRITE',
 32: 'IN_OPEN',
 64: 'IN_MOVED_FROM',
 128: 'IN_MOVED_TO',
...

EVENT_FLAGS

Value:
{'IN_IGNORED': 32768, 'IN_Q_OVERFLOW': 16384, 'IN_UNMOUNT': 8192}

IN_DONT_FOLLOW

don't follow a symlink (new in kernel 2.6.15). IN_ONLYDIR we can make sure that we don't watch the target of symlinks.
Type:
int

IN_EXCL_UNLINK

Events are not generated for children after they have been unlinked from the watched directory. (new in kernel 2.6.36).
Type:
int

OP_FLAGS

Value:
{'IN_ACCESS': 1,
 'IN_ATTRIB': 4,
 'IN_CLOSE_NOWRITE': 16,
 'IN_CLOSE_WRITE': 8,
 'IN_CREATE': 256,
 'IN_DELETE': 512,
 'IN_DELETE_SELF': 1024,
 'IN_MODIFY': 2,
...

SPECIAL_FLAGS

Value:
{'IN_DONT_FOLLOW': 33554432,
 'IN_EXCL_UNLINK': 67108864,
 'IN_ISDIR': 1073741824,
 'IN_MASK_ADD': 536870912,
 'IN_ONESHOT': 2147483648,
 'IN_ONLYDIR': 16777216}