Viewing File: /opt/hc_python/lib/python3.12/site-packages/filelock/__pycache__/_windows.cpython-312.pyc

�

`��g�����ddlmZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
dd	lmZmZej"d
k(rddlZGd�de
�ZdgZyGd
�de
�ZdgZy)�)�annotationsN)�suppress)�EACCES)�Path)�cast�)�BaseFileLock)�ensure_directory_exists�raise_on_not_writable_file�win32c� �eZdZdZdd�Zdd�Zy)�WindowsFileLock�WUses the :func:`msvcrt.locking` function to hard lock the lock file on Windows systems.c�h�t|j�t|j�tjtj
ztjz}	tj|j||jj�}	tj|tjd�||j_
y#t$r3}tj|�|j t"k7r�Yd}~yd}~wwxYw#t$r}|j t"k7r�Yd}~yd}~wwxYw)Nr)r�	lock_filer
�os�O_RDWR�O_CREAT�O_TRUNC�open�_context�mode�msvcrt�locking�LK_NBLCK�lock_file_fd�OSError�close�errnor)�self�flags�fd�	exceptions    �@/opt/hc_python/lib/python3.12/site-packages/filelock/_windows.py�_acquirezWindowsFileLock._acquires���&�t�~�~�6�#�D�N�N�3��	�	��*�*���*�*��
�


4��W�W�T�^�^�U�D�M�M�4F�4F�G��
4��N�N�2�v����:�24�D�M�M�.�����H�H�R�L� ���&�0��1����
�
��?�?�f�,��-��
�s0�5D
�%C�	D�)D�D�
	D1�D,�,D1c�h�td|jj�}d|j_tj|tj
d�t
j|�tt�5t|j�j�ddd�y#1swYyxYw)N�intr)
rrrrr�LK_UNLCKrrrrrr�unlink)r r"s  r$�_releasezWindowsFileLock._release*sl���e�T�]�]�7�7�8�B�)-�D�M�M�&��N�N�2�v����2��H�H�R�L��'�"��T�^�^�$�+�+�-�#�"�"�s�;$B(�(B1N��return�None��__name__�
__module__�__qualname__�__doc__r%r*��r$rrs��e�	4�.	.r4rc� �eZdZdZdd�Zdd�Zy)rrc��t��N��NotImplementedError�r s r$r%zWindowsFileLock._acquire8���%�%r4c��t�r7r8r:s r$r*zWindowsFileLock._release;r;r4Nr+r.r3r4r$rr5s��e�	&�	&r4)�
__future__rr�sys�
contextlibrrr�pathlibr�typingr�_apir	�_utilr
r�platformrr�__all__r3r4r$�<module>rFs`��"�	�
������F��<�<�7���!.�,�!.�`���&�,�&���r4
Back to Directory File Manager