%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/python/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/python/__pycache__/_inotify.cpython-312.pyc

�

Ϫ�f�
��<�dZddlZddlZddlmZmZddlmZGd�de�Z	de
fd�Zd	e
d
eede
de
fd�Zd	e
d
e
ddfd�Z
dejddfd�Zej j#d�Zesed��ej(j+e�Zee�y)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)�Any�cast)�FilePathc��eZdZdZy)�INotifyErrorzR
    Unify all the possible exceptions that can be raised by the INotify API.
    N)�__name__�
__module__�__qualname__�__doc__���9/usr/lib/python3/dist-packages/twisted/python/_inotify.pyrrs��r
r�returnc�j�tttj��}|dkrt	d��|S)zO
    Create an inotify instance and return the associated file descriptor.
    rzINotify initialization error.)r�int�libc�inotify_initr)�fds r�initrs1��
�c�4�$�$�&�	'�B�	�A�v��:�;�;�
�Ir
r�path�maskc��tttj||j	�j
|��}|dkrt
d|�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' - (�))rrr�inotify_add_watch�asBytesModerr)rrr�wds    r�addr#sU��
�c�4�)�)�"�d�.>�.>�.@�.E�.E�t�L�	M�B�	�A�v��5�d�X�U�2�&��J�K�K�
�Ir
rc�0�tj||�y)zM
    Remove the given watch descriptor from the inotify file descriptor.
    N)r�inotify_rm_watch)rrs  r�remover 2s��0	���"�b�!r
rc��dD]}t||d���td��g|j_tj
|j_tj
tj
g|j_tj
|j_tj
tjtjg|j_tj
|j_y)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�functions  r�initializeModuler+Ms���N�<���4��4�(�0��:�;�;�<�"$�D���� &���D����&,�l�l�F�L�L�%A�D���"�$*�L�L�D���!�'-�|�|�V�_�_�f�o�o�&V�D���#�%+�\�\�D���"r
�czCan't find C library.)rr%�ctypes.util�typingrr�twisted.python.filepathr�	Exceptionrrrrr �CDLLr+�util�find_library�namer#�cdll�LoadLibraryrrr
r�<module>r7s���
����,��9���c���C��x��}��C��C��"�s�"��"��"�62�6�;�;�2�4�2�&�{�{����$���
�-�
.�.�
�{�{���t�$����r

Zerion Mini Shell 1.0