CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
_windows.cpython-310.pyc36 linesDownload Raw Back to __pycache__
1o

2��Yi��@s�ddlmZddlZddlZddlmZddlmZddlm	Z	ddl3mZddlm
Z
dd	lmZmZejd4krkddlZddlZddlmZdZd
Zejddd�Zejgej_ejej_ddd�ZGdd�de
�ZnGdd�de
�ZdgZ dS)�)�annotationsN)�suppress)�EACCES)�Path)�cast�)�BaseFileLock)�ensure_directory_exists�raise_on_not_writable_file�win32)�wintypesil���kernel32T)�use_last_error�path�str�return�boolcCsBt�|�}|tkrt��}|dkrdS|dkrdSdSt|t@�S)a5        Check if a path is a reparse point (symlink, junction, etc.) on Windows.6 7        :param path: Path to check8        :return: True if path is a reparse point, False otherwise9        :raises OSError: If GetFileAttributesW fails for reasons other than file-not-found10        �F�)�	_kernel32�GetFileAttributesW�INVALID_FILE_ATTRIBUTES�ctypes�get_last_errorr�FILE_ATTRIBUTE_REPARSE_POINT)r�attrs�err�r�{E:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\filelock/_windows.py�_is_reparse_points11rc@�$eZdZdZd	dd�Zd	dd�ZdS)12�WindowsFileLock�WUses the :func:`msvcrt.locking` function to hard lock the lock file on Windows systems.r�Nonec13Cs�t|j�t|j�t|j�rd|j��}t|��tjtjBtjB}zt�	|j||j14j�}WntyG}z
|jt
kr<�WYd}~dSd}~wwz15t�|tjd�Wntyp}zt�|�|jt
kre�WYd}~dSd}~ww||j16_dS)Nz1Lock file is a reparse point (symlink/junction): r)r17�	lock_filer	r�OSError�os�O_RDWR�O_CREAT�O_TRUNC�open�_context�mode�errnor�msvcrt�locking�LK_NBLCK�close�lock_file_fd)�self�msg�flags�fd�	exceptionrrr�_acquire2s:181920���21���2223����WindowsFileLock._acquirecCsltd|jj�}d|j_t�|tjd�t�|�tt	��t24|j���Wd�dS1s/wYdS)N�intr)
rr+r2r.r/�LK_UNLCKr&r1rr%rr$�unlink)r3r6rrr�_releasePs2526"��WindowsFileLock._releaseN�rr#��__name__�27__module__�__qualname__�__doc__r8r=rrrrr!/s28r!c@r )29r!r"rr#cC�t��N��NotImplementedError�r3rrrr8^�r9cCrErFrGrIrrrr=arJr>Nr?r@rrrrr![s30)rrrr)!�31__future__rr&�sys�32contextlibrr-r�pathlibr�typingrZ_apirZ_utilr	r33�platformrr.rrr�WinDLLr�LPCWSTRr�argtypes�DWORD�restyperr!�__all__rrrr�<module>s.343536,�
Aluode/PerceptionLabPortable · CoolFace