
    .Ph/	                    $   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 d
Zej        dk    r G d de          Zn=	 d dlZej        ej        ej        ej        fZdZn# eef$ r Y nw xY w G d de          ZddgZdS )    )annotationsN)suppress)ENOSYS)Path)cast   )BaseFileLock)ensure_directory_existsFwin32c                  "    e Zd ZdZddZddZdS )UnixFileLockHUses the :func:`fcntl.flock` to hard lock the lock file on unix systems.returnNonec                    t           NNotImplementedErrorselfs    N/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/filelock/_unix.py_acquirezUnixFileLock._acquire       %%    c                    t           r   r   r   s    r   _releasezUnixFileLock._release   r   r   Nr   r   __name__
__module____qualname____doc__r   r    r   r   r   r      sB        VV	& 	& 	& 	&	& 	& 	& 	& 	& 	&r   r   Tc                  "    e Zd ZdZddZddZdS )r   r   r   r   c                   t          | j                   t          j        t          j        z  }t          | j                                                  s|t          j        z  }t          j        | j        || j	        j
                  }t          t                    5  t          j        || j	        j
                   d d d            n# 1 swxY w Y   	 t          j        |t          j        t          j        z             || j	        _        d S # t&          $ rA}t          j        |           |j        t,          k    rd}t/          |          |Y d }~d S d }~ww xY w)NzEFileSystem does not appear to support flock; use SoftFileLock instead)r
   	lock_fileosO_RDWRO_TRUNCr   existsO_CREATopen_contextmoder   PermissionErrorfchmodfcntlflockLOCK_EXLOCK_NBlock_file_fdOSErrorcloseerrnor   r   )r   
open_flagsfd	exceptionmsgs        r   r   zUnixFileLock._acquire'   sx   #DN333RZ/J''..00 )bj(
T]5GHHB/** 2 2	"dm01112 2 2 2 2 2 2 2 2 2 2 2 2 2 20B =>>> .0***  B B B?f,,aC-c22	A -,,,,,Bs*    CCC,D 
E6EEc                    t          d| j        j                  }d | j        _        t          j        |t          j                   t          j        |           d S )Nint)r   r-   r5   r1   r2   LOCK_UNr'   r7   )r   r:   s     r   r   zUnixFileLock._release9   sG     eT]788B)-DM&KEM***HRLLLLLr   Nr   r   r#   r   r   r   r   $   sB        VV	0 	0 	0 	0$	 	 	 	 	 	r   	has_fcntl)
__future__r   r'   sys
contextlibr   r8   r   pathlibr   typingr   _apir	   _utilr
   r@   platformr   r1   r2   r3   r4   r?   _ImportErrorAttributeError__all__r#   r   r   <module>rM      sj   " " " " " " 				 



                               * * * * * * 	<7& & & & &| & & & &[%-F 		 (   
    |   @ s   A1 1A;:A;