HEX
Server: nginx/1.24.0
System: Linux localhost 5.15.0-46-generic #49-Ubuntu SMP Thu Aug 4 18:03:25 UTC 2022 x86_64
User: www (1000)
PHP: 8.3.27
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: //usr/lib/python3/dist-packages/twisted/python/__pycache__/_inotify.cpython-310.pyc
o

�b�
�@s�dZddlZddlZddlmZddlmZGdd�de�Zde	fdd	�Z
d
e	dede	de	fd
d�Zd
e	de	ddfdd�Zdej
ddfdd�Zej�d�ZesSed��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.
�N)�cast)�FilePathc@seZdZdZdS)�INotifyErrorzR
    Unify all the possible exceptions that can be raised by the INotify API.
    N)�__name__�
__module__�__qualname__�__doc__�r	r	�9/usr/lib/python3/dist-packages/twisted/python/_inotify.pyrsr�returncCs"ttt���}|dkrtd��|S)zO
    Create an inotify instance and return the associated file descriptor.
    rzINotify initialization error.)r�int�libc�inotify_initr)�fdr	r	r
�initsrr�path�maskcCs<ttt�||��j|��}|dkrtd|�d|�d���|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}.
    @param path: The path to watch via inotify.
    @param mask: Bitmask specifying the events that inotify should monitor.
    rzFailed to add watch on 'z' - (�))rrr
�inotify_add_watch�asBytesModerr)rrr�wdr	r	r
�add#s	rrcCst�||�dS)zM
    Remove the given watch descriptor from the inotify file descriptor.
    N)r
�inotify_rm_watch)rrr	r	r
�remove2srr
cCspdD]}t||d�durtd��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}.
    )rrrNzlibc6 2.4 or higher needed)�getattr�ImportErrorr�argtypes�ctypes�c_int�restyper�c_char_p�c_uint32r)r
�functionr	r	r
�initializeModuleMs�

r#�czCan't find C library.)rr�ctypes.util�typingr�twisted.python.filepathr�	Exceptionrrrrr�CDLLr#�util�find_library�namer�cdll�LoadLibraryr
r	r	r	r
�<module>s