Part of twisted.internet.inotify View Source View In Hierarchy
Instance Variables | _buffer | a str containing the data read from the inotify fd.
|
_watchpoints | a dict that maps from inotify watch ids to watchpoints
objects
| |
_watchpaths | a dict that maps from watched paths to the inotify watch
ids
|
Method | __init__ | Undocumented |
Method | connectionLost | Release the inotify file descriptor and do the necessary cleanup |
Method | fileno | Get the underlying file descriptor from this inotify observer. Required
by abstract.FileDescriptor
subclasses.
|
Method | doRead | Read some data from the observed file descriptors |
Method | watch | Watch the 'mask' events in given path. Can raise
INotifyError when there's a problem while adding a
directory.
|
Method | ignore | Remove the watch point monitoring the given path |
Method | _addWatch | Private helper that abstracts the use of ctypes. |
Method | _rmWatch | Private helper that abstracts the use of ctypes. |
Method | _doRead | Work on the data just read from the file descriptor. |
Method | _addChildren | This is a very private method, please don't even think about using it. |
Method | _isWatched | Helper function that checks if the path is already monitored and returns its watchdescriptor if so. |
Inherited from FileDescriptor:
Method | logPrefix | Returns the default log prefix |
Method | writeSomeData | Write as much as possible of the given data, immediately. |
Method | doWrite | Called when data can be written. |
Method | writeConnectionLost | Indicates write connection was lost. |
Method | readConnectionLost | Indicates read connection was lost. |
Method | write | Reliably write some data. |
Method | writeSequence | Reliably write a sequence of data. |
Method | loseConnection | Close the connection at the next available opportunity. |
Method | loseWriteConnection | Undocumented |
Method | stopReading | Stop waiting for read availability. |
Method | stopWriting | Stop waiting for write availability. |
Method | startReading | Start waiting for read availability. |
Method | startWriting | Start waiting for write availability. |
Method | registerProducer | Register to receive data from a producer. |
Method | unregisterProducer | Stop consuming data from a producer, without disconnecting. |
Method | stopConsuming | Stop consuming data. |
Method | resumeProducing | Undocumented |
Method | pauseProducing | Undocumented |
Method | stopProducing | Stop producing data. |
Method | _postLoseConnection | Called after a loseConnection(), when all data has been written. |
Method | _closeWriteConnection | Undocumented |
Private helper that abstracts the use of ctypes.
Calls the internal inotify API and checks for any errors after the call. If there's an errorINotify._addWatch
can raise an INotifyError. If there's no error it proceeds creating a
watchpoint and adding a watchpath for inverse lookup of the file descriptor
from the path.
Private helper that abstracts the use of ctypes.
Calls the internal inotify API to remove an fd from inotify then removes the corresponding watchpoint from the internal mapping together with the file descriptor from the watchpath.abstract.FileDescriptor
subclasses.
This is a very private method, please don't even think about using it.
Note that this is a fricking hack... it's because we cannot be fast enough in adding a watch to a directory and so we basically end up getting here too late if some operations have already been going on in the subdir, we basically need to catchup. This eventually ends up meaning that we generate double events, your app must be resistant.INotifyError
when there's a problem while adding a
directory.
Parameters | path | The path needing monitoring
(type: FilePath
) |
mask | The events that should be watched
(type: int
) | |
autoAdd | if True automatically add newly created subdirectories
(type: boolean
) | |
callbacks | A list of callbacks that should be called when an event happens in the
given path.
(type: list of callables
) | |
recursive | Also add all the subdirectories in this path
(type: boolean
) |
Parameters | path | The path that should be ignored
(type: FilePath
) |
Parameters | path | The path that should be checked
(type: FilePath
) |