| Server IP : 198.38.94.13 / Your IP : 216.73.217.33 Web Server : Apache System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : revivere ( 1140) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /opt/saltstack/salt/lib/python3.10/site-packages/filelock/__pycache__/ |
Upload File : |
o
;j� � @ s` d dl mZ d dlZd dlZd dlZd dlmZmZ d dlm Z dd d
�Z
ddd
�Zd
d
gZdS )� )�annotationsN)�EACCES�EISDIR)�Path�filename�str�return�Nonec C s| zt �| �}W n
ty Y dS w |jdkr:|jtj@ s#ttd| ��t�|j�r<t j
dkr4ttd| ��ttd| ��dS dS )a4
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.
Nr zPermission denied�win32zIs a directory)
�os�stat�OSError�st_mtime�st_mode�S_IWUSR�PermissionErrorr �S_ISDIR�sys�platform�IsADirectoryErrorr )r Z file_stat� r �B/opt/saltstack/salt/lib/python3.10/site-packages/filelock/_util.py�raise_on_not_writable_file
s �
�r �
Path | strc C s t | �jjddd� dS )zp
Ensure the directory containing the file exists (create it if necessary).
:param filename: file.
T)�parents�exist_okN)r �parent�mkdir)r r r r �ensure_directory_exists( s r )r r r r )r r r r )
�
__future__r r r r �errnor r �pathlibr r r �__all__r r r r �<module> s
�