Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib64/python3.7/site-packages/twisted/python/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/site-packages/twisted/python/__pycache__/_inotify.cpython-37.pyc

B

:��]
�@stdZddlZddlZGdd�de�Zdd�Zdd�Zd	d
�Zdd�Zej	�
d
�Zes\ed��ej
�e�Zee�dS)z�
Very low-level ctypes-based interface to Linux inotify(7).

ctypes and a version of libc which supports inotify system calls are
required.
�Nc@seZdZdZdS)�INotifyErrorzR
    Unify all the possible exceptions that can be raised by the INotify API.
    N)�__name__�
__module__�__qualname__�__doc__�rr�J/opt/alt/python37/lib64/python3.7/site-packages/twisted/python/_inotify.pyrsrcCst��}|dkrtd��|S)zO
    Create an inotify instance and return the associated file descriptor.
    rzINotify initialization error.)�libc�inotify_initr)�fdrrr�initsrcCs0t�||��j|�}|dkr,td||f��|S)a�
    Add a watch for the given path to the inotify file descriptor, and return
    the watch descriptor.

    @param fd: The file descriptor returned by C{libc.inotify_init}.
    @type fd: L{int}

    @param path: The path to watch via inotify.
    @type path: L{twisted.python.filepath.FilePath}

    @param mask: Bitmask specifying the events that inotify should monitor.
    @type mask: L{int}
    rz"Failed to add watch on '%r' - (%r))r	�inotify_add_watchZasBytesMode�pathr)rr�mask�wdrrr�add#srcCst�||�dS)zM
    Remove the given watch descriptor from the inotify file descriptor.
    N)r	�inotify_rm_watch)rrrrr�remove8srcCstx$dD]}t||d�dkrtd��qWg|j_tj|j_tjtjg|j_tj|j_tjtjtj	g|j
_tj|j
_dS)z�
    Initialize the module, checking if the expected APIs exist and setting the
    argtypes and restype for C{inotify_init}, C{inotify_add_watch}, and
    C{inotify_rm_watch}.
    )r
r
rNzlibc6 2.4 or higher needed)�getattr�ImportErrorr
�argtypes�ctypes�c_int�restyper�c_char_p�c_uint32r
)r	�functionrrr�initializeModuleTs


r�czCan't find C library.)rrZctypes.util�	Exceptionrrrrr�utilZfind_library�namer�cdll�LoadLibraryr	rrrr�<module>
s