403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
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-312.pyc
�

��ob����dZddlmZmZmZddlZddlZddlZddlZddl	Z	ddl
m
Z
ddlmZddl
mZmZddlmZdd	lmZdd
lmZej*rddlmZmZmZmZmZddlmZeeeeeeefZe	j>d
dfd�Z 			dd�Z!y)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)�MissingInfoNamespace�	NoSysPath)�relpath)�datetime_to_epoch)�Walker)�BinaryIO�Optional�Text�Tuple�Union)�FS�utf-8c	�>�tj|d|d��}|xs
t�}|5|j|gd���}|D�]�\}}t	|j
r|dzn|�}	tjs|	j|d�}	|jd�r.|jdd	d
�}
tj|
�}|dd}nf|jxstj�}
|
j |
j"|
j$|
j&|
j(|
j*f}tj,|	|�}	|j.�|j.j0d
z|_|j
r)|xj2d
zc_|j7|d���`	|j9|�}|j;||	����	d
d
d
�y
#t4$rY�qwxYw#t<$r%|j7||j?|��Y���wxYw#1swYy
xYw)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�
getsyspath�writer
�	readbytes)�src_fs�filer�encoding�walker�_zip�gen_walk�pathr(�zip_namer"�_mtime�zip_time�mt�zip_info�sys_paths                �-/usr/lib/python3/dist-packages/fs/compress.py�	write_ziprNs���2�?�?�4�c�{�t�T�D�
�
�v�x�F�	
�.3��;�;�v�2O�;�P��"�,	3�J�D�$��T�[�[�t�c�z�d�C�H��7�7�#�?�?�8�Y�?���!�!�&�)� �8�8�F�J��=������1��!�!�A�;���]�]�7�h�o�o�&7���G�G�R�X�X�r�v�v�r�w�w��	�	�2�9�9�U�����x��:�H�
��#�#�/�-1�-=�-=�-B�-B�b�-H�H�*��{�{��&�&�$�.�&��
�
�h��,�3�%�0�0��6�H��J�J�x��2�Y,	3�.3�.3��:(�
��
��!�D��M�M�(�F�,<�,<�T�,B�C�D��Q.3�.3�sT�DH�*G�-5H�#G"�4H�	G�H�G�H�"*H�H�H�H�Hc��tjtjtjtj
tjtjtjtjtjtjtjtjtjtjtj tji}gd�}dj#|xsd�}t%|t&j(t&j*f�rtj,||��}ntj,||��}t/j.�}	|xs
t1�}|5|j3|gd���}
|
D�]�\}}t5|�}
t&j6s|
j9|d�}
tj:|
�}|j=d	�r|j?d	d
|	�}n|j@xs|	}t%|tB�rtE|�}t%|tF�rtI|�}||_%|D]+\}}tM||d���tO||tM||d���-|j=d�rtM|jPd
d�|_)|jTr(tj|_+|jY|���L|j?|jVtj�|_+|jZ|_-|j]|�5}|jY||�ddd����	ddd�y#1swY���xYw#1swYyxYw)a�Write the contents of a filesystem to a tar 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 (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.

    ))�uidrP)�gidrQ)�uname�user)�gname�groupzw:{}�)r)�fileobjrrrr!rr"Nrri)/r�block_special_file�tarfile�BLKTYPE�	character�CHRTYPE�	directory�DIRTYPE�fifo�FIFOTYPErA�REGTYPE�socket�AREGTYPE�symlink�SYMTYPE�unknown�format�
isinstancer*�	text_type�binary_type�openr/r
r(rr+r,�TarInfor-r.r1rr�float�int�mtime�getattr�setattrr:rr)�type�addfile�size�openbin)r@rArrBrC�type_map�tar_attrr�_tar�current_timerErFr(�tar_name�tar_inforo�tarattr�infoattr�bin_files                   rM�	write_tarrks���0	�'�'�������������������7�+�+����7�?�?����W�-�-����g�o�o����g�.�.�	�H�W�H��=�=��*��+�D��$�������8�9��|�|�D�t�,���|�|�D�t�4���9�9�;�L�
�
�v�x�F�	
�$5��;�;�v�2O�;�P��"�"	5�J�D�$��t�}�H��7�7�#�?�?�8�Y�?�����x�0�H��!�!�&�)������\�B���
�
�5����%��*�)�%�0���%��'��E�
��"�H�N�%-�
N�!����4��4�0�<��H�g�w�t�X�t�/L�M�
N��!�!�(�+� '��(8�(8�&�%� H��
��{�{� '����
����X�&� (���T�Y�Y���� H��
� $�	�	��
��^�^�D�)�5�X��L�L��8�4�5�5�C"	5�$5�$5�F5�5��G$5�$5�s,�	C(M3�2CM3�>M&�M3�&M0�+M3�3M<)NrN)"�__doc__�
__future__rrr�typingr*rYr/r&r�enumsr�errorsr	r
rFrr�walkr
�
TYPE_CHECKINGrrrrr�baserrn�ZipTime�ZIP_DEFLATEDrNr�r%rM�<module>r�s����I�H�
�
������3��#��	���=�=���C��c�3��S�0�1�G��$�$�
��I3�^�
��P5r%

Youez - 2016 - github.com/yon3zu
LinuXploit