CasperSecurity

Current Path : /lib/python3/dist-packages/twisted/python/__pycache__/
Upload File :
Current File : //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

Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY