D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
clcagefslib
/
__pycache__
/
Filename :
io.cpython-311.pyc
back
Copy
� ����lh>� � � d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlmZ d dl m Z ej e� � Z dd�Zej d� � � Zd� Zd d �Zd � Zd� ZdS )� N)� clcaptain)�ExternalProgramFailedTc �$ � t | d� � 5 }|� � � cddd� � S # 1 swxY w Y dS # t t f$ r> t j d| z t j d� � |s� t j d� � Y dS w xY w)z� Helper for read file, process errors and make backup before read :param: filename `str` name of file for read :param: exit_on_error `bool` use sys.exit on error or raise exception �rNzError: failed to read � ) �open� readlines�OSError�IOError�secureio�logging�SILENT_FLAG�sys�exit)�filename� exit_on_error�_files �Bopt/cloudlinux/venv/lib/python3.11/site-packages/clcagefslib/io.py� read_filer s� � �� �(�C� � � %�E��?�?�$�$� %� %� %� %� %� %� %� %� %� %� %� %���� %� %� %� %� %� %�� �W�� � � ���1�H�<�h�>R�TU�V�V�V�� ����������� ���s- �A �3�A �7�A �7�A � AB�Bc � � t | � � S �N)r )�paths r �read_file_cachedr % s � ��T�?�?�� c �z � t j | ||||t j �� � }t j |� � |d u S )N)�logger)r �create_dir_securer �closefd)r �perm�uid�gid�parent_path�fds r �make_userdirr$ + sF � � � #��d�C��k�(�2B� � � �B� ��R���� ��:�r Fc � � |s t j � |� � �s2 t j |� � nj# t $ r]}|j t j k rt � d|� d�� � nt � d|� �|�� � Y d }~nd }~ww xY w t j | |� � n�# t t f$ r�}d|� d| � dt |� � � dd � � � �}t � ||�� � |rt j ||d � � nt# |t$ j �� � Y d }~d S d }~ww xY wdS ) NzSymlink z does not existz Error: Unable to remove symlink )�exc_infoz Error: failed to create symlink z to z : �ErrnozErr codeT)�fileF)�osr �islink�unlinkr �errno�ENOENTr �info�errorr �symlinkr �str�replacer r �printr �stderr)� dest_path� link_name� write_log�force�silent�e�msgs r �switch_symlinkr<