Viewing File: /opt/hc_python/lib/python3.12/site-packages/filelock/__pycache__/_util.cpython-312.pyc

�

`��g���\�ddlmZddlZddlZddlZddlmZmZddlm	Z	d	d�Z
d
d�ZddgZy)�)�annotationsN)�EACCES�EISDIR)�Pathc�r�	tj|�}|jdk7r�|jtj
zst
td|��tj|j�r5tjdk(rt
td|��ttd|��yy#t$rYywxYw)a3
    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)�filename�	file_stats  �=/opt/hc_python/lib/python3.12/site-packages/filelock/_util.py�raise_on_not_writable_filer
s�����G�G�H�%�	����Q���!�!�D�L�L�0�!�&�*=�x�H�H��<�<�	�)�)�*��|�|�w�&�%�f�.A�8�L�L�(��0@�(�K�K�
+�	������s�B*�*	B6�5B6c�P�t|�jjdd��y)zp
    Ensure the directory containing the file exists (create it if necessary).

    :param filename: file.

    T)�parents�exist_okN)r�parent�mkdir)rs r�ensure_directory_existsr's!��	��N������t��<�rr)r�str�return�None)rz
Path | strr r!)
�
__future__rr	r
r�errnorr�pathlibrrr�__all__�rr�<module>r's1��"�	��
� ��L�:=�� ��r
Back to Directory File Manager