§
    /›jg  ã                  óZ  — d dl mZ d dlZd dlZd dlmZ d dlmZ d dlm	Z	 d dl
mZ ddlmZ dd	lmZmZ ej        d
k    rZd dlZd dlZd dlmZ dZdZ ej        dd¬¦  «        Zej        gej        _        ej        ej        _        dd„Z G d„ de¦  «        Zn G d„ de¦  «        ZdgZ dS )é    )ÚannotationsN)Úsuppress)ÚEACCES)ÚPath)Úcasté   )ÚBaseFileLock)Úensure_directory_existsÚraise_on_not_writable_fileÚwin32)Úwintypesi   l   ÿÿ Úkernel32T)Úuse_last_errorÚpathÚstrÚreturnÚboolc                óÄ   — t                                | ¦  «        }|t          k    r%t          j        ¦   «         }|dk    rdS |dk    rdS dS t          |t          z  ¦  «        S )a  
        Check if a path is a reparse point (symlink, junction, etc.) on Windows.

        :param path: Path to check

        :returns: True if path is a reparse point, False otherwise

        :raises OSError: If GetFileAttributesW fails for reasons other than file-not-found

        é   Fé   )Ú	_kernel32ÚGetFileAttributesWÚINVALID_FILE_ATTRIBUTESÚctypesÚget_last_errorr   ÚFILE_ATTRIBUTE_REPARSE_POINT)r   ÚattrsÚerrs      úN/home/lighthouse/health/venv/lib/python3.11/site-packages/filelock/_windows.pyÚ_is_reparse_pointr       sf   € õ ×,Ò,¨TÑ2Ô2ˆØÕ+Ò+Ð+åÔ'Ñ)Ô)ˆCØ�aŠxˆxØ�uØ�aŠxˆxØ�uà�5Ý�EÕ8Ñ8Ñ9Ô9Ð9ó    c                  ó"   — e Zd ZdZdd„Zdd„ZdS )ÚWindowsFileLocka~  
        Uses the :func:`msvcrt.locking` function to hard lock the lock file on Windows systems.

        Lock file cleanup: Windows attempts to delete the lock file after release, but deletion is
        not guaranteed in multi-threaded scenarios where another thread holds an open handle. The lock
        file may persist on disk, which does not affect lock correctness.
        r   ÚNonec                ód  — t          | j        ¦  «         t          | j        ¦  «         t          | j        ¦  «        rd| j        › �}t	          |¦  «        ‚t
          j        t
          j        z  }	 t          j        | j        ||  	                    ¦   «         ¦  «        }	 t          j        |t          j        d¦  «         || j        _        d S # t          $ r0}t          j        |¦  «         |j        t"          k    r‚ Y d }~d S d }~ww xY w# t          $ r}|j        t"          k    r‚ Y d }~d S d }~ww xY w)Nz1Lock file is a reparse point (symlink/junction): r   )r   Ú	lock_filer
   r    ÚOSErrorÚosÚO_RDWRÚO_CREATÚopenÚ
_open_modeÚmsvcrtÚlockingÚLK_NBLCKÚ_contextÚlock_file_fdÚcloseÚerrnor   )ÚselfÚmsgÚflagsÚfdÚ	exceptions        r   Ú_acquirezWindowsFileLock._acquire;   sO  € Ý& t¤~Ñ6Ô6Ð6Ý# D¤NÑ3Ô3Ð3õ ! ¤Ñ0Ô0ð #ØZÈ$Ì.ÐZÐZ�Ý˜c‘l”lÐ"õ ”	Ý”*ñð ð4Ý”W˜Tœ^¨U°D·O²OÑ4EÔ4EÑFÔF�ð
4Ý”N 2¥v¤¸Ñ:Ô:Ð:ð 24�D”MÔ.Ð.Ð.øõ ð ð ð Ý”H˜R‘L”L�LØ ”­&Ò0Ð0Øð 1Ð0Ð0Ð0Ð0Ð0øøøøðøøøøõ ð ð ð Ø”?¥fÒ,Ð,Øð -Ð,Ð,Ð,Ð,Ð,øøøøðøøøs0   Á0-D	 Â C Ã
DÃ%DÄDÄ	
D/ÄD*Ä*D/c                ó`  — t          d| j        j        ¦  «        }d | j        _        t          j        |t          j        d¦  «         t          j        |¦  «         t          t          ¦  «        5  t          | j        ¦  «                             ¦   «          d d d ¦  «         d S # 1 swxY w Y   d S )NÚintr   )r   r0   r1   r-   r.   ÚLK_UNLCKr(   r2   r   r'   r   r&   Úunlink)r4   r7   s     r   Ú_releasezWindowsFileLock._releaseX   sÑ   € Ý�e˜Tœ]Ô7Ñ8Ô8ˆBØ)-ˆDŒMÔ&ÝŒN˜2�vœ°Ñ2Ô2Ð2ÝŒH�R‰LŒLˆLå�'Ñ"Ô"ð .ð .Ý�T”^Ñ$Ô$×+Ò+Ñ-Ô-Ð-ð.ð .ð .ñ .ô .ð .ð .ð .ð .ð .ð .ð .øøøð .ð .ð .ð .ð .ð .s   Á/'B#Â#B'Â*B'N©r   r$   ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r9   r>   © r!   r   r#   r#   2   sF   € € € € € ð	ð 	ð	4ð 	4ð 	4ð 	4ð:	.ð 	.ð 	.ð 	.ð 	.ð 	.r!   r#   c                  ó"   — e Zd ZdZdd„Zdd„ZdS )r#   zWUses the :func:`msvcrt.locking` function to hard lock the lock file on Windows systems.r   r$   c                ó   — t           ‚©N©ÚNotImplementedError©r4   s    r   r9   zWindowsFileLock._acquiref   ó   € Ý%Ð%r!   c                ó   — t           ‚rH   rI   rK   s    r   r>   zWindowsFileLock._releasei   rL   r!   Nr?   r@   rE   r!   r   r#   r#   c   sB   € € € € € ØeÐeð	&ð 	&ð 	&ð 	&ð	&ð 	&ð 	&ð 	&ð 	&ð 	&r!   )r   r   r   r   )!Ú
__future__r   r(   ÚsysÚ
contextlibr   r3   r   Úpathlibr   Útypingr   Ú_apir	   Ú_utilr
   r   Úplatformr   r-   r   r   r   ÚWinDLLr   ÚLPCWSTRr   ÚargtypesÚDWORDÚrestyper    r#   Ú__all__rE   r!   r   ú<module>r\      sŽ  ðØ "Ð "Ð "Ð "Ð "Ð "à 	€	€	€	Ø 
€
€
€
Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð Ø FÐ FÐ FÐ FÐ FÐ FÐ FÐ Fà„<�7ÒÐØ€M€M€MØ€M€M€MØÐÐÐÐÐð $.Ð Ø(Ðð �”˜j¸Ð>Ñ>Ô>€IØ-5Ô-=Ð,>€IÔ Ô)Ø+3¬>€IÔ Ô(ð:ð :ð :ð :ð.-.ð -.ð -.ð -.ð -.˜,ñ -.ô -.ð -.ð -.ðb&ð &ð &ð &ð &˜,ñ &ô &ð &ð ð€€€r!   