Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
_windows.cpython-313.pyc35 linesDownload Raw Back to __pycache__
1�

2�jg��~�SSKJr SSKrSSKrSSKJr SSKJr SSKJ	r	 SSK3Jr SSKJ
r
 SS	KJrJr \R"S4:XakSSKrSSKrSSKJr SrS
r\R."SSS9r\R2/\R4l\R8\R4lSSjr"SS\
5rO"SS\
5rS/r g)�)�annotationsN)�suppress)�EACCES)�Path)�cast�)�BaseFileLock)�ensure_directory_exists�raise_on_not_writable_file�win32)�wintypesil���kernel32T)�use_last_errorc��[RU5nU[:Xa$[R"5nUS:XagUS:Xagg[U[-5$)z�5Check if a path is a reparse point (symlink, junction, etc.) on Windows.6 7:param path: Path to check8 9:returns: True if path is a reparse point, False otherwise10 11:raises OSError: If GetFileAttributesW fails for reasons other than file-not-found12 13�F�)�	_kernel32�GetFileAttributesW�INVALID_FILE_ATTRIBUTES�ctypes�get_last_error�bool�FILE_ATTRIBUTE_REPARSE_POINT)�path�attrs�errs   �WD:\code\apps\devtools\python\user_packages\Python313\site-packages\filelock/_windows.py�_is_reparse_pointrsS���,�,�T�2���+�+��'�'�)�C��a�x���a�x����E�8�8�9�9�c�,�\rSrSrSrSSjrSSjrSrg)�WindowsFileLock�2aV14Uses the :func:`msvcrt.locking` function to hard lock the lock file on Windows systems.15 16Lock file cleanup: Windows attempts to delete the lock file after release, but deletion is17not guaranteed in multi-threaded scenarios where another thread holds an open handle. The lock18file may persist on disk, which does not affect lock correctness.19c��[UR5 [UR5 [UR5(aSUR3n[	U5e[20R[21R-n[22R"URX R55n[R"U[RS5 X0Rlg![a5n[23R"U5 UR [":waeSnAgSnAff=f![anUR [":waeSnAgSnAff=f)Nz1Lock file is a reparse point (symlink/junction): r)r�	lock_filer24r�OSError�os�O_RDWR�O_CREAT�open�25_open_mode�msvcrt�locking�LK_NBLCK�_context�lock_file_fd�close�errnor)�self�msg�flags�fd�	exceptions     r�_acquire�WindowsFileLock._acquire;s���&�t�~�~�6�#�D�N�N�3�!����0�0�I�$�.�.�IY�Z���c�l�"��	�	��*�*��
�

4��W�W�T�^�^�U�O�O�4E�F��264��N�N�2�v����:�24�M�M�.�����H�H�R�L� ���&�0��1����
�
��?�?�f�,��-��
�s0�/D*�1&C(�(27D'�2+D"�"D'�*28E�4E�Ec�v�[SURR5nSURl[R"U[R29S5 [R"U5 [[5 [UR5R5 SSS5 g!,(df   g=f)N�intr)
rr.r/r+r,�LK_UNLCKr&r0rr%rr$�unlink)r2r5s  r�_release�WindowsFileLock._releaseXsl���e�T�]�]�7�7�8�B�)-�D�M�M�&��N�N�2�v����2��H�H�R�L��'�"��T�^�^�$�+�+�-�#�"�"�s�=$B*�*30B8�N��return�None��__name__�31__module__�__qualname__�__firstlineno__�__doc__r7r=�__static_attributes__r?rrr!r!2s��	�	4�:	.rr!c�,�\rSrSrSrSSjrSSjrSrg)r!�czWUses the :func:`msvcrt.locking` function to hard lock the lock file on Windows systems.c��[e�N��NotImplementedError�r2s rr7r8f���%�%rc��[erMrNrPs rr=r>irQrr?Nr@rCr?rrr!r!cs��e�	&�	&r)r�strrAr)!�32__future__rr&�sys�33contextlibrr1r�pathlibr�typingr�_apir	�_utilr34r�platformrr+r
rr�WinDLLr�LPCWSTRr�argtypes�DWORD�restyperr!�__all__r?rr�<module>rbs���"�	�35������F��<�<�7�����$.� �(���
�
�j��>�I�-5�-=�-=�,>�I� � �)�+3�>�>�I� � �(�:�.-.�,�-.�b&�,�&���r
codekingpro/portable-devtools · Team Ai