File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/validate/__pycache__/path.cpython-310.pyc
Back
o ;j � @ s* d Z ddlZd dd�Zdd� Zdd � ZdS )z� :codeauthor: Pedro Algarvio (pedro@algarvio.me) salt.utils.validate.path ~~~~~~~~~~~~~~~~~~~~~~~~ Several path related validators � NFc C sx t �| t j�rt �| t j�rdS t �| t j�r t �| t j�s dS |du r&dS t j�| �}t �|t j�s5dS t �|t j�S )a Check if a given path is writeable by the current user. :param path: The path to check :param check_parent: If the path to check does not exist, check for the ability to write to the parent directory instead :returns: True or False TF)�os�access�F_OK�W_OK�path�dirname)r Zcheck_parentZ parent_dir� r �L/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/validate/path.py�is_writeable s r c C s$ t �| t j�rt �| t j�rdS dS )z� Check if a given path is readable by the current user. :param path: The path to check :returns: True or False TF)r r r �R_OK�r r r r �is_readable2 s r c C s t �| t j�S )z� Check if a given path is executable by the current user. :param path: The path to check :returns: True or False )r r �X_OKr r r r � is_executableB s r )F)�__doc__r r r r r r r r �<module> s $
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings