§
    Mj£  ã                  ó>  — 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 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)ÚENOENT)Úcasté   )ÚBaseFileLock)Úraise_on_exist_ro_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
        :return: 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      ú3/usr/lib/python3/dist-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 )ÚWindowsFileLockúWUses the :func:`msvcrt.locking` function to hard lock the lock file on windows systems.r   ÚNonec                óö  — t          | j        ¦  «         t          | j        ¦  «        rd| j        › �}t	          |¦  «        ‚t
          j        t
          j        z  t
          j        z  }	 t          j	        | j        |¦  «        }	 t          j        |t          j        d¦  «         || _        d S # t          $ r t          j        |¦  «         Y d S 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   Ú	lock_fileÚOSErrorÚosÚO_RDWRÚO_CREATÚO_TRUNCÚopenÚmsvcrtÚlockingÚLK_NBLCKÚ_lock_file_fdÚcloseÚerrnor   )ÚselfÚmsgÚmodeÚfdÚ	exceptions        r   Ú_acquirezWindowsFileLock._acquire0   s  € Ý" 4¤?Ñ3Ô3Ð3õ ! ¤Ñ0Ô0ð #ØZÈ$Ì.ÐZÐZ�Ý˜c‘l”lÐ"õ ”	Ý”*ñå”*ñð ð
,Ý”W˜Tœ_¨dÑ3Ô3�ð
,Ý”N 2¥v¤¸Ñ:Ô:Ð:ð *,�DÔ&Ð&Ð&øõ ð !ð !ð !Ý”H˜R‘L”L�L�L�L�Lð!øøøøõ ð ð ð Ø”?¥fÒ,Ð,Øð -Ð,Ð,Ð,Ð,Ð,øøøøðøøøs*   Á)C Â B- Â-CÃCÃ
C8ÃC3Ã3C8c                ó  — t          t          | j        ¦  «        }d | _        t          j        |t          j        d¦  «         t          j        |¦  «         	 t          j        | j	        ¦  «         d S # t          $ r Y d S w xY w)Nr   )r   Úintr/   r,   r-   ÚLK_UNLCKr'   r0   Úremover$   r&   )r2   r5   s     r   Ú_releasezWindowsFileLock._releaseK   s~   € Ý•c˜4Ô-Ñ.Ô.ˆBØ!%ˆDÔÝŒN˜2�vœ°Ñ2Ô2Ð2ÝŒH�R‰LŒLˆLðÝ”	˜$œ/Ñ*Ô*Ð*Ð*Ð*øåð ð ð Ø��ðøøøs   ÁA2 Á2
B Á?B N©r   r"   ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r7   r<   © r   r   r    r    -   sB   € € € € € ØeÐeð	,ð 	,ð 	,ð 	,ð6
	ð 
	ð 
	ð 
	ð 
	ð 
	r   r    c                  ó"   — e Zd ZdZdd„Zdd„ZdS )r    r!   r   r"   c                ó   — t           ‚©N©ÚNotImplementedError©r2   s    r   r7   zWindowsFileLock._acquire\   ó   € Ý%Ð%r   c                ó   — t           ‚rF   rG   rI   s    r   r<   zWindowsFileLock._release_   rJ   r   Nr=   r>   rC   r   r   r    r    Y   sB   € € € € € ØeÐeð	&ð 	&ð 	&ð 	&ð	&ð 	&ð 	&ð 	&ð 	&ð 	&r   )r   r   r   r   )Ú
__future__r   r'   Úsysr1   r   Útypingr   Ú_apir   Ú_utilr   Úplatformr   r,   r
   r   r   ÚWinDLLr   ÚLPCWSTRr   ÚargtypesÚDWORDÚrestyper   r    Ú__all__rC   r   r   ú<module>rX      sd  ðØ "Ð "Ð "Ð "Ð "Ð "à 	€	€	€	Ø 
€
€
€
Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð Ø )Ð )Ð )Ð )Ð )Ð )à„<�7ÒÐØ€M€M€MØ€M€M€MØÐÐÐÐÐð $.Ð Ø(Ðð �”˜j¸Ð>Ñ>Ô>€IØ-5Ô-=Ð,>€IÔ Ô)Ø+3¬>€IÔ Ô(ð:ð :ð :ð :ð((ð (ð (ð (ð (˜,ñ (ô (ð (ð (ðX&ð &ð &ð &ð &˜,ñ &ô &ð &ð ð€€€r   