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__/zipfs.cpython-312.pyc
�

��ob\E���dZddlmZmZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZddl
mZdd	lmZdd
lmZmZddlmZddlmZdd
lmZddlmZddlmZmZmZm Z ddl!m"Z"ddl#m$Z$ddl%m&Z&ejNr8ddlm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1ddlm2Z2ddl3m4Z4ejjdd��Z6Gd�de�Z7Gd�de&�Z8ejrGd�de&��Z:ejrGd�de��Z;y) z(Manage the filesystem in a Zip archive.
�)�print_function�unicode_literalsN)�datetime�)�errors)�	url_quote)�FS)�	write_zip)�ResourceType�Seek)�Info)�
RawWrapper)�MemoryFS)�open_fs)�dirname�forcedir�normpath�relpath)�Permissions)�datetime_to_epoch)�WrapFS)
�Any�BinaryIO�
Collection�Dict�List�Optional�SupportsInt�Text�Tuple�Union)�RawInfo)�SubFS�R�	ReadZipFS)�boundc���eZdZ�fd�Zej
dkr!d	d�Zd	d�Zd�Zd�Z	e
jfd�Z�xZ
Se
jfd�Z�xZ
S)
�_ZipExtFilec����|jx|_}|j|�j|_d|_t
t|�|j|�d|�y)Nr�r)	�_zip�getinfo�	file_size�_end�_pos�superr(�__init__�open)�self�fs�namer+�	__class__s    ��*/usr/lib/python3/dist-packages/fs/zipfs.pyr1z_ZipExtFile.__init__0sK����7�7�"��	�D��L�L��&�0�0��	���	�
�k�4�)�$�)�)�D�/�3��E�)��c��|jj|�dn|�}|xjt|�z
c_|S�N���)�_f�readr/�len�r3�size�bufs   r7r?z_ZipExtFile.read>s1���'�'�,�,�T�\�r�t�<�C��I�I��S��!�I��Jr8c��|jj|�dn|�}|xjt|�z
c_|Sr<)r>�read1r/r@rAs   r7rEz_ZipExtFile.read1Ds1���'�'�-�-�d�l���=�C��I�I��S��!�I��Jr8c��|jS�N)r/�r3s r7�tellz_ZipExtFile.tellJs���9�9�r8c��y)NT�rHs r7�seekablez_ZipExtFile.seekableNs��r8c���t|�}|tjk(r||jz
}|tjk(s|tjk(r|dkr�tdj
|���|tjk(r/|dkDrtdj
|���||jz
}nGtdj
|tjtjtj���||jkr1|jj|j�|_d|_|j||jz
�|jS)afChange stream position.

            Change the stream position to the given byte offset. The
            offset is interpreted relative to the position indicated by
            ``whence``.

            Arguments:
                offset (int): the offset to the new position, in bytes.
                whence (int): the position reference. Possible values are:
                    * `Seek.set`: start of stream (the default).
                    * `Seek.current`: current position; offset may be negative.
                    * `Seek.end`: end of stream; offset must be negative.

            Returns:
                int: the new absolute position.

            Raises:
                ValueError: when ``whence`` is not known, or ``offset``
                    is invalid.

            Note:
                Zip compression does not support seeking, so the seeking
                is emulated. Seeking somewhere else than the current position
                will need to either:
                    * reopen the file and restart decompression
                    * read and discard data to advance in the file

            r�Negative seek position {}�Positive seek position {}�+Invalid whence ({}, should be {}, {} or {}))�intr�currentr/�set�
ValueError�format�endr.r+r2r5r>r?)r3�offset�whence�_whences    r7�seekz_ZipExtFile.seekQs��<�&�k�G��$�,�,�&��$�)�)�#���$�,�,�&�'�T�X�X�*=��A�:�$�%@�%G�%G��%O�P�P��D�H�H�$��A�:�$�%@�%G�%G��%O�P�P��$�)�)�#�� �A�H�H�����4�<�<���������	�	�!��)�)�.�.����3�����	��I�I�f�t�y�y�(�)��9�9�r8c�0�t|�}|j�}|tjk(r|dkr�t	dj|���|tjk(r"||zdkr�t	dj|���|tjk(r|dkDrat	dj|���t	dj|tjtjtj���|jj||�S)aChange stream position.

            Change the stream position to the given byte offset. The
            offset is interpreted relative to the position indicated by
            ``whence``.

            Arguments:
                offset (int): the offset to the new position, in bytes.
                whence (int): the position reference. Possible values are:
                    * `Seek.set`: start of stream (the default).
                    * `Seek.current`: current position; offset may be negative.
                    * `Seek.end`: end of stream; offset must be negative.

            Returns:
                int: the new absolute position.

            Raises:
                ValueError: when ``whence`` is not known, or ``offset``
                    is invalid.

            rrNrOrP)
rQrIrrSrTrUrRrVr>rZ)r3rWrXrYr/s     r7rZz_ZipExtFile.seek�s���.�&�k�G��9�9�;�D��$�(�(�"��A�:�$�%@�%G�%G��%O�P�P��D�L�L�(��&�=�1�$�$�%@�%G�%G��%O�P�P��D�H�H�$��A�:�$�%@�%G�%G��%O�P�P� �A�H�H�����4�<�<��������7�7�<�<���0�0r8)r=)�__name__�
__module__�__qualname__r1�sys�version_infor?rErIrLrrSrZ�
__classcell__�r6s@r7r(r(/sJ���F����&� �	�	�	�	�'+�h�h�3	�n'+�h�h�)	1r8r(c�r�eZdZdZdej
ddfd�Zejrdej
ddfd�Z	yy)�ZipFSa.Read and write zip files.

    There are two ways to open a `ZipFS` for the use cases of reading
    a zip file, and creating a new one.

    If you open the `ZipFS` with  ``write`` set to `False` (the default)
    then the filesystem will be a read-only filesystem which maps to
    the files and directories within the zip file. Files are
    decompressed on the fly when you open them.

    Here's how you might extract and print a readme from a zip file::

        with ZipFS('foo.zip') as zip_fs:
            readme = zip_fs.readtext('readme.txt')

    If you open the `ZipFS` with ``write`` set to `True`, then the `ZipFS`
    will be an empty temporary filesystem. Any files / directories you
    create in the `ZipFS` will be written in to a zip file when the `ZipFS`
    is closed.

    Here's how you might write a new zip file containing a ``readme.txt``
    file::

        with ZipFS('foo.zip', write=True) as new_zip:
            new_zip.writetext(
                'readme.txt',
                'This zip file was written by PyFilesystem'
            )


    Arguments:
        file (str or io.IOBase): An OS filename, or an open file object.
        write (bool): Set to `True` to write a new zip file, or `False`
            (default) to read an existing zip file.
        compression (int): Compression to use (one of the constants
            defined in the `zipfile` module in the stdlib).
        temp_fs (str or FS): An FS URL or an FS instance to use to
            store data prior to zipping. Defaults to creating a new
            `~fs.tempfs.TempFS`.

    F�utf-8�temp://__ziptemp__c�>�|rt||||��St||��S)N)�compression�encoding�temp_fs)ri)�
WriteZipFSr%)�cls�file�writerhrirjs      r7�__new__z
ZipFS.__new__�s,�����+��'��
��T�H�5�5r8c��yrGrK)r3rmrnrhrirjs      r7r1zZipFS.__init__�s��
r8N)
r\r]r^�__doc__�zipfile�ZIP_DEFLATEDro�typing�
TYPE_CHECKINGr1rKr8r7rdrd�sJ��(�\��(�(��$�
6�$���
��,�,��(�
		�r8rdc�n��eZdZdZej
ddf�fd�	Zd�Zd�Zd�Z	d�Z
�fd	�Z			dd
�Z�xZ
S)rkzA writable zip file.rerfc����||_||_||_||_t	|�|_t
|j
j��|_tt|�/|j
�yrG)�_filerhri�_temp_fs_urlr�_temp_fs�dict�getmeta�_metar0rkr1)r3rmrhrirjr6s     �r7r1zWriteZipFS.__init__s[�����
�&��� ��
�#�����(��
��$�-�-�/�/�1�2��
�
�j�$�(����7r8c�~�d}|j|j|j|j|j�S)Nz?WriteZipFS({!r}, compression={!r}, encoding={!r}, temp_fs={!r}))rUrxrhriry)r3�ts  r7�__repr__zWriteZipFS.__repr__s0��M���x�x��
�
�D�$4�$4�d�m�m�T�EV�EV�W�Wr8c�8�dj|j�S)Nz<zipfs-write '{}'>�rUrxrHs r7�__str__zWriteZipFS.__str__s��#�*�*�4�:�:�6�6r8c��|j|fSrG�rz�r3�paths  r7�
delegate_pathzWriteZipFS.delegate_paths���}�}�d�"�"r8c��|jSrGr�rHs r7�delegate_fszWriteZipFS.delegate_fs!s���}�}�r8c����|j�s+	|j�|jj�tt
|��y#|jj�wxYwrG)�isclosedr
rz�closer0rk�r3r6s �r7r�zWriteZipFS.close%sL����}�}��
&���� ��
�
�#�#�%�
�j�$�%�'���
�
�#�#�%�s�A�A,c��|j�sDt|j|xs|j|xs|j|xs|j
��yy)a5Write zip to a file.

        Arguments:
            file (str or io.IOBase, optional): Destination file, may be
                a file name or an open file handle.
            compression (int, optional): Compression to use (one of the
                constants defined in the `zipfile` module in the stdlib).
            encoding (str, optional): The character encoding to use
                (default uses the encoding defined in
                `~WriteZipFS.__init__`).

        Note:
            This is called automatically when the ZipFS is closed.

        )rhriN)r�r
rzrxrhri)r3rmrhris    r7r
zWriteZipFS.write_zip.sG��,�}�}����
�
��"��
�
�'�;�4�+;�+;�!�2�T�]�]�	
�r8)NNN)r\r]r^rqrrrsr1r�r�r�r�r�r
rarbs@r7rkrksF����
�(�(��$�8� X�
7�#��(����	r8rkc����eZdZdZdddddddd�Zejjd�fd�	�Zd�Z	d�Z
d�Zed	��Z
dd
�Zd�Zd�Z		dd
�Zdd�Zd�Zd�Z�fd�Zd�Zdd�Z�xZS)r%zA readable zip file.FT)�case_insensitive�network�	read_only�supports_rename�thread_safe�
unicode_paths�virtualc���tt|��||_||_tj|d�|_d|_y)Nr*)	r0r%r1rxrirr�ZipFiler+�
_directory_fs)r3rmrir6s   �r7r1zReadZipFS.__init__[s:���	�i��'�)���
� ��
��O�O�D�#�.��	�!��r8c�8�dj|j�S)NzReadZipFS({!r})r�rHs r7r�zReadZipFS.__repr__ds�� �'�'��
�
�3�3r8c�8�dj|j�S)Nz<zipfs '{}'>r�rHs r7r�zReadZipFS.__str__hs���$�$�T�Z�Z�0�0r8c���tt|��}|jj|�rt	|�}t
jr|j|j�S|S)z"Convert a path to a zip file name.)	rr�
_directory�isdirr�six�PY2�encoderir�s  r7�_path_to_zip_namezReadZipFS._path_to_zip_namelsL���x��~�&���?�?� � ��&��D�>�D��7�7��;�;�t�}�}�-�-��r8c��|j�|j5|j��t�x|_}|jj�D]�}|}tjr|j|jd�}|jd�r|j|d���V|jt|�d��|j|���|jcddd�S#1swYyxYw)zC`MemoryFS`: a filesystem with the same folder hierarchy as the zip.N�replace�/T)�recreate)�check�_lockr�rr+�namelistr�r��decoderi�endswith�makedirsr�create)r3�_fs�zip_name�
resource_names    r7r�zReadZipFS._directoryvs���	
�
�
��
�Z�Z�	&��!�!�)�+3�:�5��"�S� $�	�	� 2� 2� 4�2�H�$,�M��w�w�(5�(<�(<�T�]�]�I�(V�
�$�-�-�c�2����]�T��B����W�]�%;�d��K��
�
�=�1�2��%�%�	&�	&�	&�s�CC/�/C8c���|j|�}|xsd}i}|dk(r6ddd�|d<d|v�r�dttj�i|d<t1|�S|jj|�}|j|jd�|d<hd	�j|��s&|j|�}	|jj|�}d|vr_|jt|jrtjntj�tt|j��d
�|d<d|vr9|j D�cic] }|j#d�s
|t%||���"c}|d<d
|vrU|j&rI|j(dk(r:dt+|j&dz	dz��j-�i|d
<t1|�St1|�Scc}w#t.$r
Yt1|�SwxYw)NrKr��T)r5�is_dir�basic�details�type>�zip�accessr�)rBr��modifiedr��_r�r9�permissions�i�)�mode)�validatepathrQr�	directoryr�r,r5r��
isdisjointr�r+r-rmrr�	date_time�	__slots__�
startswith�getattr�
external_attr�
create_systemr�dump�KeyErrorr
)	r3r��
namespaces�_path�raw_info�
basic_infor��zip_info�ks	         r7r,zReadZipFS.getinfo�s����!�!�$�'���%�2�
����C�<�)+�t� <�H�W���J�&�'-�s�<�3I�3I�/J�&K���#�R�H�~��M���0�0��7�J�)3���J�DU�DU� V�H�W��/�:�:�:�F��1�1�$�7���#�y�y�0�0��:�H�
!�J�.�$,�$6�$6�$'�#-�#4�#4�!-� 6� 6�%1�%6�%6�%�
):� (�(�*<�*<� =�)�
/���+��
�*�&.�%7�%7�+� !�#$�<�<��#4��w�x��3�3�+����
 �:�-�#�1�1�h�6L�6L�PQ�6Q� -�{�)1�)?�)?�2�)E��)M�0"�"&�$�&�2�H�X�.��H�~��t�H�~���+��# ���:�H�~��?�s�2G�%G�	G,�+G,c�L�|j�tj|��rG�r�r�ResourceReadOnly)r3r��infos   r7�setinfozReadZipFS.setinfo�����
�
���%�%�d�+�+r8c�X�|j�|jj|�SrG)r�r��listdirr�s  r7r�zReadZipFS.listdir�s ���
�
�����&�&�t�,�,r8c�L�|j�tj|��rGr�)r3r�r�r�s    r7�makedirzReadZipFS.makedir�s��	
�
�
���%�%�d�+�+r8c�^�|j�d|vsd|vsd|vrtj|��|jj	|�stj
|��|jj
|�rtj|��|j|�}t||�S)N�w�+�a)
r�rr�r��exists�ResourceNotFoundr��FileExpectedr�r()r3r�r��	buffering�kwargsr�s      r7�openbinzReadZipFS.openbin�s����
�
���$�;�#��+�����)�)�$�/�/����%�%�d�+��)�)�$�/�/�
�_�_�
"�
"�4�
(��%�%�d�+�+��)�)�$�/���4��*�*r8c�L�|j�tj|��rGr�r�s  r7�removezReadZipFS.remove�r�r8c�L�|j�tj|��rGr�r�s  r7�	removedirzReadZipFS.removedir�r�r8c�x��tt|��t|d�r|jj�yy)Nr+)r0r%r��hasattrr+r�s �r7r�zReadZipFS.close�s-���
�i��$�&��4�� ��I�I�O�O��!r8c���|j�|jj|�stj|��|j|�}|jj|�}|SrG)r�r��isfilerr�r�r+r?)r3r�r��	zip_bytess    r7�	readbyteszReadZipFS.readbytes�sV���
�
�����%�%�d�+��)�)�$�/�/��)�)�$�/���I�I�N�N�8�,�	��r8c���|dk(rVt|jtj�r2t	|j�}t	|�}dj||�St
j||��)Nr4zzip://{}!/{})�
isinstancerxr��string_typesrrUr�NoURL)r3r��purpose�quoted_file�quoted_paths     r7�geturlzReadZipFS.geturl�sW���d�?�z�$�*�*�c�6F�6F�G�#�D�J�J�/�K�#�D�/�K�!�(�(��k�B�B��,�,�t�W�-�-r8)rerG)NF)r*r=)�download)r\r]r^rqr}r�CreateFailed�	catch_allr1r�r�r��propertyr�r,r�r�r�r�r�r�r�r�r�rarbs@r7r%r%Ms�����"��� ����
�E����"�"�"�#�"�4�1���&��&�$2�h,�
-���	,�+�,�
,�
��.r8)<rq�
__future__rrr_rtr�rrrr�r�
_url_toolsr�baser	�compressr
�enumsrrr�r
�iotoolsr�memoryfsr�openerrr�rrrrr�r�timer�wrapfsrrurrrrrrrrr r!r"�subfsr#�TypeVarr$r(rd�python_2_unicode_compatiblerkr%rKr8r7�<module>rs����8�
�
�
����!���%�����6�6�$�#��	������������s�+�.�A�B1�*�B1�JI�F�I�X� � �I��I�!�I�X� � �q.��q.�!�q.r8

Youez - 2016 - github.com/yon3zu
LinuXploit