HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/twisted/python/__pycache__/_inotify.cpython-38.pyc
U


W[
�@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�9/usr/lib/python3/dist-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�remove8srcCspdD]}t||d�dkrtd��qg|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
Zargtypes�ctypesZc_intZrestyperZc_char_pZc_uint32r
)r	Zfunctionrrr�initializeModuleTs

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