HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib64/python3.10/site-packages/filelock/__pycache__/_util.cpython-310.pyc
o

!we��@s`ddlmZddlZddlZddlZddlmZmZddlm	Z	dd	d
�Z
ddd
�Zd
d
gZdS)�)�annotationsN)�EACCES�EISDIR)�Path�filename�str�return�NonecCs|zt�|�}Wn
tyYdSw|jdkr:|jtj@s#ttd|��t�|j�r<t	j
dkr4ttd|��ttd|��dSdS)a/
    Raise an exception if attempting to open the file for writing would fail.
    This is done so files that will never be writable can be separated from
    files that are writable but currently locked
    :param filename: file to check
    :raises OSError: as if the file was opened for writing.
    NrzPermission denied�win32zIs a directory)
�os�stat�OSError�st_mtime�st_mode�S_IWUSR�PermissionErrorr�S_ISDIR�sys�platform�IsADirectoryErrorr)r�	file_stat�r�G/home/arjun/projects/env/lib/python3.10/site-packages/filelock/_util.py�raise_on_not_writable_file
s�

�r�
Path | strcCst|�jjddd�dS)zm
    Ensure the directory containing the file exists (create it if necessary)
    :param filename: file.
    T)�parents�exist_okN)r�parent�mkdir)rrrr�ensure_directory_exists$sr)rrrr	)rrrr	)
�
__future__rrrr�errnorr�pathlibrrr�__all__rrrr�<module>s

	�