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

��obT���dZddlmZmZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
ddlmZddlmZdd	lmZdd
lmZddlmZmZddlmZdd
lmZddlmZmZm Z ejBrPddlm"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-ddl.Z.ddl/Z/ddlm0Z0ddlm1Z1ddl2m3Z3ddl4m5Z5ejldd��Z7ejpGd�dejr��Z:Gd�de;�Z<ejpGd�de��Z=y)z(Manage a volatile in-memory filesystem.
�)�absolute_import�unicode_literalsN)�OrderedDict)�RLock�)�errors)�overload)�FS)�copy_modified_time)�ResourceType�Seek)�Info)�Mode)�iteratepath�normpath�split)�Any�BinaryIO�
Collection�Dict�Iterable�Iterator�List�Optional�SupportsInt�Text�Tuple�Union)�_OpendirFactory)�RawInfo)�Permissions)�SubFS�_M�MemoryFS)�boundc����eZdZ�fd�Zd�Zed��Zejd��Z	d�Z
d�Zd�Zd�Z
d	�ZeZdd
�Z�fd�Zdd�Zd
�Zd�Zdd�Zd�Zej0fd�Zd�Zdd�Zd�Zd�Zd�Z�xZS)�_MemoryFilec�P��tt|��||_||_t|�|_||_tjtj|j�|_
tj�|_tj�|_d|_|jj$rU|jj&5|jj)d�|jj%�ddd�y|jj*ri|jj&5|jj)dt,j.�|jj1�|_ddd�yy#1swYyxYw#1swYyxYw�Nr)�superr'�__init__�_path�
_memory_fsr�_mode�
_dir_entry�typing�cast�io�BytesIO�
bytes_file�	_bytes_io�time�
accessed_time�
modified_time�pos�truncate�lock�seek�	appending�os�SEEK_END�tell)�self�path�	memory_fs�mode�	dir_entry�	__class__s     ��-/usr/lib/python3/dist-packages/fs/memoryfs.pyr+z_MemoryFile.__init__5s.���
�k�4�)�+���
�#����$�Z��
�#��� ���R�Z�Z��1E�1E�F���!�Y�Y�[���!�Y�Y�[�������:�:������%�%�
*����#�#�A�&����'�'�)�
*�
*��Z�Z�
!�
!����%�%�
1����#�#�A�r�{�{�3��>�>�.�.�0���
1�
1�"�
*�
*��
1�
1�s�6F�<A
F�F�F%c�T�d}|j|j|j��S)Nz<memoryfile '{path}' '{mode}'>)rBrD)�formatr,r.)rA�	_templates  rG�__str__z_MemoryFile.__str__Ms%��4�	����T�Z�Z�d�j�j��A�A�c�6�|jj�S�N)r.�to_platform_bin�rAs rGrDz_MemoryFile.modeRs���z�z�)�)�+�+rLc#��K�|jj5|jj|j�d��|jj�|_ddd�y#1swYyxYw�wrN)r/r;r5r<r9r@rPs rG�
_seek_lockz_MemoryFile._seek_lockWsV�����_�_�
!�
!�	-��N�N������)���~�~�*�*�,�D�H�	-�	-�	-�s�A7�A	A+�"	A7�+A4�0A7c�X�tj�x|j_|_y)z"Called when file data is modified.N)r6r/r8rPs rG�	on_modifyz_MemoryFile.on_modify_���>B�Y�Y�[�H����%��(:rLc�X�tj�x|j_|_y)zCalled when file is accessed.N)r6r/r7rPs rG�	on_accessz_MemoryFile.on_accessdrUrLc��yrN�rPs rG�flushz_MemoryFile.flushis��rLc#�K�|jj|j�|jD]}|���y�wrN)r5r<r9)rA�lines  rG�__iter__z_MemoryFile.__iter__ms4���������D�H�H�%��N�N�	�D��J�	�s�<>c��|j�5|j�t|j�cddd�S#1swYyxYwrN)rRrW�nextr5rPs rGr_z_MemoryFile.nextss7��
�_�_�
�	(��N�N������'�	(�	(�	(�s�%A�A	c���|jjstd��|j�5|j	�|j
j
|�cddd�S#1swYyxYw�NzFile not open for reading)r.�reading�IOErrorrRrWr5�readline�rA�sizes  rGrdz_MemoryFile.readline{sV���z�z�!�!��5�6�6�
�_�_�
�	1��N�N���>�>�*�*�4�0�	1�	1�	1���+A'�'A0c����|jsM|jj5|jj|�tt
|��ddd�yy#1swYyxYwrN)�closedr/r;�remove_open_filer*r'�close�rArFs �rGrkz_MemoryFile.close�sU����{�{����%�%�
1����0�0��6��k�4�.�0�
1�
1��
1�
1�s�.A�A%c���|jjstd��|j�5|j	�|j
j
|�cddd�S#1swYyxYwra)r.rbrcrRrWr5�readres  rGrnz_MemoryFile.read�sV���z�z�!�!��5�6�6�
�_�_�
�	-��N�N���>�>�&�&�t�,�	-�	-�	-�rgc�.�|jjSrN)r.rbrPs rG�readablez_MemoryFile.readable�����z�z�!�!�!rLc���|jjstd��|j�5|j	�|j
j
|�cddd�S#1swYyxYwra)r.rbrcrRrWr5�readinto)rA�buffers  rGrsz_MemoryFile.readinto�sV���z�z�!�!��5�6�6�
�_�_�
�	3��N�N���>�>�*�*�6�2�	3�	3�	3�rgc���|jjstd��|j�5|j	�|j
j
|�cddd�S#1swYyxYwra)r.rbrcrRrWr5�	readlines)rA�hints  rGrvz_MemoryFile.readlines�sV���z�z�!�!��5�6�6�
�_�_�
�	2��N�N���>�>�+�+�D�1�	2�	2�	2�rgc��y)NTrYrPs rG�seekablez_MemoryFile.seekable�s��rLc��|j�5|j�|jj|t	|��cddd�S#1swYyxYwrN)rRrWr5r<�int)rAr9�whences   rGr<z_MemoryFile.seek�sE���_�_�
�	9��N�N���>�>�&�&�s�C��K�8�	9�	9�	9�s�5A�Ac��|jSrN)r9rPs rGr@z_MemoryFile.tell�s���x�x�rLc���|j�5|j�|jj|�}|��|jj	�|kry|jjdtj�}|jjd||z
z�|jj||ztj�|xs|cddd�S#1swYyxYw)Nr�)	rRrTr5r:r@r<r>r?�write)rArf�new_size�	file_sizes    rGr:z_MemoryFile.truncate�s���
�_�_�
�	$��N�N���~�~�.�.�t�4�H���D�N�N�$7�$7�$9�D�$@� �N�N�/�/��2�;�;�?�	����$�$�U�d�Y�.>�%?�@����#�#�T�E�I�$5�r�{�{�C��#�8�	$�	$�	$�s�C	C$�$C-c�.�|jjSrN)r.�writingrPs rG�writablez_MemoryFile.writable�rqrLc���|jjstd��|j�5|j	�|j
j
|�cddd�S#1swYyxYw)NzFile not open for writing)r.r�rcrRrTr5r�)rA�datas  rGr�z_MemoryFile.write�sV���z�z�!�!��5�6�6�
�_�_�
�	.��N�N���>�>�'�'��-�	.�	.�	.�rgc��|j�5|j�|jj|�ddd�y#1swYyxYwrN)rRrTr5�
writelines)rA�sequences  rGr�z_MemoryFile.writelines�s=��
�_�_�
�	0��N�N���N�N�%�%�h�/�	0�	0�	0�s�,A�ArN)���) �__name__�
__module__�__qualname__r+rK�propertyrD�
contextlib�contextmanagerrRrTrWrZr]r_�__next__rdrkrnrprsrvryr
�setr<r@r:r�r�r��
__classcell__�rFs@rGr'r'3s����1�0B�
�,��,����-��-�I�
I�

��(��H�1�1�-�"�3�2�� $�x�x�9��	$�"�.�0rLr'c��eZdZd�Zed��Zed��Zed��Zed��Z	ed��Z	ed��Z	dd	�Z	d
�Z
d�Zd�Zd
�Z
d�Zd�Zd�Zd�Zdd�Zy)�	_DirEntryc��||_||_t�|_g|_d|_t
�|_tj�}||_	||_
||_|jstj�|_yyrN)�
resource_type�namer�_dir�_open_files�_bytes_filerr;r6�created_timer7r8�is_dirr2r3)rAr�r��current_times    rGr+z_DirEntry.__init__�sp��*�����	��M��	��������G��	��y�y�{��(���)���)����{�{�!�z�z�|�D��rLc��|jSrN)r�rPs rGr4z_DirEntry.bytes_file�s�����rLc�<�|jtjk(SrN)r�r�	directoryrPs rGr�z_DirEntry.is_dir�s���!�!�\�%;�%;�;�;rLc�.�|j5|jr
	ddd�ytjtj
|j�}|jdtj�|j�cddd�S#1swYyxYwr))r;r�r0r1r2r3r�r<r>r?r@)rAr�s  rGrfz_DirEntry.size�sp���Y�Y�	*��{�{��	*�	*�%�k�k�"�*�*�d�6F�6F�G��� � ��B�K�K�0�"�'�'�)�
	*�	*�	*�s�B�AB�Bc��yrNrY�rAr��defaults   rG�	get_entryz_DirEntry.get_entry����	
rLc��yrNrY�rAr�s  rGr�z_DirEntry.get_entry�r�rLc��yrNrYr�s   rGr�z_DirEntry.get_entryr�rLNc�`�|jsJd��|jj||�S)Nzmust be a directory)r�r��getr�s   rGr�z_DirEntry.get_entry	s)���{�{�1�1�1�{��y�y�}�}�T�7�+�+rLc�"�||j|<yrN�r�)rAr�rEs   rG�	set_entryz_DirEntry.set_entrys��#��	�	�$�rLc��|j|=yrNr�r�s  rG�remove_entryz_DirEntry.remove_entrys
���I�I�d�OrLc�8�|jj�yrN)r��clearrPs rGr�z_DirEntry.clears���	�	���rLc��||jvSrNr�r�s  rG�__contains__z_DirEntry.__contains__s���t�y�y� � rLc�,�t|j�SrN)�lenr�rPs rG�__len__z_DirEntry.__len__s���4�9�9�~�rLc�H�t|jj��SrN)�listr��keysrPs rGr�z_DirEntry.list"s���D�I�I�N�N�$�%�%rLc�:�|jj|�yrN)r��append�rA�memory_files  rG�
add_open_filez_DirEntry.add_open_file&���������,rLc�:�|jj|�yrN)r��remover�s  rGrjz_DirEntry.remove_open_file*r�rLc���|xsd}d|j|jd�i}d|vrIddgt|j�|j|j
|j|jd�|d<t|�S)NrY�basic)r�r��details�accessed�modified)�_write�typerfr�r��created)	r�r�r{r�rfr7r8r�r)rA�
namespaces�infos   rG�to_infoz_DirEntry.to_info.sz���%�2�
��$�)�)�t�{�{�C�D���
�"�%�z�2��D�.�.�/��	�	� �.�.� �.�.��,�,�
�D��O��D�z�rLrN)r�r�r�r+r�r4r�rfr	r�r�r�r�r�r�r�r�rjr�rYrLrGr�r��s���,�"� �� ��<��<��*��*��
��
��
��
��
��
�,�
$���!��&�-�-�
rLr�c����eZdZdZdddddddd�Z�fd�Zd�Zd�Zd	�Zd
�Z	�fd�Z
dd�Zd
�Ze
jrdd�Z		dd�Zdd�Zdd�Zdd�Zd�Zd�Zd�Z		dd�Zd�Z�xZS)r$a�A filesystem that stored in memory.

    Memory filesystems are useful for caches, temporary data stores,
    unit testing, etc. Since all the data is in memory, they are very
    fast, but non-permanent. The `MemoryFS` constructor takes no
    arguments.

    Examples:
        Create with the constructor::

            >>> from fs.memoryfs import MemoryFS
            >>> mem_fs = MemoryFS()

        Or via an FS URL::

            >>> import fs
            >>> mem_fs = fs.open_fs('mem://')

    F�T)�case_insensitive�invalid_path_chars�network�	read_only�thread_safe�
unicode_paths�virtualc���|jj�|_|jtjd�|_tt|�#�y)zCreate an in-memory filesystem.�N)	�_meta�copy�_make_dir_entryrr��rootr*r$r+rls �rGr+zMemoryFS.__init__^s>����Z�Z�_�_�&��
��(�(��)?�)?��D��	�
�h��&�(rLc��y)Nz
MemoryFS()rYrPs rG�__repr__zMemoryFS.__repr__es��rLc��y)Nz<memfs>rYrPs rGrKzMemoryFS.__str__is��rLc��t||�SrN)r�)rAr�r�s   rGr�zMemoryFS._make_dir_entryms�����-�-rLc��|j5t|�}|j}t|�D]5}|�
ddd�y|js
ddd�y|j|�}�7|cddd�S#1swYyxYw)z6Get a directory entry, or `None` if one doesn't exist.N)�_lockrr�rr�r�)rA�dir_path�
current_entry�path_components    rG�_get_dir_entryzMemoryFS._get_dir_entryqs����Z�Z�		!���)�H� �I�I�M�"-�h�"7�
H�� �(��		!�		!�%�+�+��		!�		!�!.� 7� 7�� G�
�
H�!�		!�		!�		!�s�)A3�
A3�A3�3A<c�D��|js|`tt|��SrN)�_closedr�r*r$rkrls �rGrkzMemoryFS.closes����|�|��	��X�t�*�,�,rLc��|j|�}|j|�}|�tj|��|j	|��S�N)r�)�validatepathr�r�ResourceNotFoundr�)rArBr�r,rEs     rG�getinfozMemoryFS.getinfo�sM���!�!�$�'���'�'��.�	����)�)�$�/�/�� � �J� �7�7rLc�:�|j�|j|�}|j5|j|�}|�t	j
|��|jst	j|��|j�cddd�S#1swYyxYwrN)	�checkr�r�r�rr�r��DirectoryExpectedr�)rArBr,rEs    rG�listdirzMemoryFS.listdir�s����
�
���!�!�$�'��
�Z�Z�	$��+�+�E�2�I�� ��-�-�d�3�3��#�#��.�.�t�4�4��>�>�#�	$�	$�	$�s�AB�Bc��yrNrY)rArB�factorys   rG�opendirzMemoryFS.opendir�s��rLc��|j|�}|j5|dk(r1|r|j|�cddd�Stj|��t|�\}}|j
|�}|�tj|��|j|�}|�|stj|��|�2|jtj|�}	|j||	�|j|�cddd�S#1swYyxYw�N�/)
r�r�r�r�DirectoryExistsrr�r�r�r�rr�r�)
rArB�permissions�recreater,r��dir_name�
parent_dirrE�new_dirs
          rG�makedirzMemoryFS.makedir�s����!�!�$�'��
�Z�Z�	&���|���<�<��-�	&�	&�
!�0�0��6�6�!&�u���H�h��,�,�X�6�J��!��-�-�d�3�3�"�,�,�X�6�I��$�X��,�,�T�2�2�� ��.�.�|�/E�/E�x�P���$�$�X�w�7��<�<��%�)	&�	&�	&�s�D�B9D�Dc�p�t|j|��\}}t|j|��\}}|j5|j|�}	|	�||	vrt	j
|��|	j
|�}
|
jrt	j|��|j|�}|�t	j
|��|s||vrt	j|��|j||
�|	j|�||
_|rt||||�ddd�y#1swYyxYwrN)rr�r�r�rr�r�r��FileExpected�DestinationExistsr�r�r�r)rA�src_path�dst_path�	overwrite�
preserve_time�src_dir�src_name�dst_dir�dst_name�
src_dir_entry�	src_entry�
dst_dir_entrys            rG�movez
MemoryFS.move�s(��!�$�"3�"3�H�"=�>����!�$�"3�"3�H�"=�>����
�Z�Z�	C� �/�/��8�M��$��
�(E��-�-�h�7�7�%�/�/��9�I�����)�)�(�3�3� �/�/��8�M��$��-�-�h�7�7��8�}�#<��.�.�x�8�8�
�#�#�H�i�8��&�&�x�0�%�I�N��"�4��4��B�+	C�	C�	C�s
�CD,�,D5c�F�t|j|��\}}t|j|��\}}|j5|j|�}	|	�||	vrt	j
|��|	j
|�}
|
jst	j|��|j|�}|�|s||vrt	j
|��|j||
�|	j|�||
_|rt||||�ddd�y#1swYyxYwrN)
rr�r�r�rr�r�r�r�r�r�r�r)rArr�createrr	r
rrr
rrs            rG�movedirzMemoryFS.movedir�s��!�$�"3�"3�H�"=�>����!�$�"3�"3�H�"=�>����
�Z�Z�	C� �/�/��8�M��$��
�(E��-�-�h�7�7�%�/�/��9�I��#�#��.�.�x�8�8�!�/�/��8�M��$�V��
�8U��-�-�h�7�7�
�#�#�H�i�8��&�&�x�0�%�I�N��"�4��4��B�)	C�	C�	C�s
�CD�D c��t|�}|j�|j|�}t|�\}}|st	j
|��|j5|j|�}	|	�|	jst	j|��|jr�||	vr3|jtj|�}
|	j||
�n2|j|�}
|jrt	j |��|
jrt	j
|��t#||||
��}|
j%|�|cddd�S||	vrt	j|��|	j'|�}
|
jrt	j
|��t#||||
��}|
j%|�|cddd�S#1swYyxYw)N)rBrCrDrE)r�validate_binr�rrrr�r�r�r�rr�r�filer��	exclusive�
FileExistsr'r�r�)rArBrD�	buffering�optionsr.r,r��	file_name�parent_dir_entry�file_dir_entry�mem_files            rG�openbinzMemoryFS.openbin�s����T�
��
�����!�!�$�'��#�E�l���)���%�%�d�+�+�
�Z�Z�#	�#�2�2�8�<���'�/?�/F�/F��-�-�d�3�3��|�|��$4�4�%)�%9�%9�,�:K�:K�Y�%W�N�$�.�.�y�.�I�%)�%8�%8��%?�N����$�/�/��5�5�!�(�(� �-�-�d�3�3�&��$�T�^����,�,�X�6��-#	�#	�0� 0�0��-�-�d�3�3�-�7�7�	�B�N��$�$��)�)�$�/�/�"��d����H�
�(�(��2��G#	�#	�#	�s�C,G
�A,G
�
Gc��|j|�}|j5t|�\}}|j|�}|�||vrt	j
|��t
jt|j|��}|jrt	j|��|j|�ddd�y#1swYyxYwrN)r�r�rr�rr�r0r1r�r�rr�)rArBr,r�rrrs       rGr�zMemoryFS.remove#s����!�!�$�'��
�Z�Z�	5�"'��,��H�i�#�2�2�8�<���'�9�<L�+L��-�-�d�3�3�#�[�[��D�4G�4G��4N�O�N��$�$��)�)�$�/�/��)�)�)�4�	5�	5�	5�s�BB=�=Cc���|j|�}|dk(rtj��|j|�stj|��|j|�yr�)r�r�RemoveRootError�isempty�DirectoryNotEmpty�
removetree)rArBr,s   rG�	removedirzMemoryFS.removedir4sU���!�!�$�'���C�<��(�(�*�*��|�|�D�!��*�*�4�0�0�
	
����rLc���|j|�}|j5|dk(r$|jj�	ddd�yt	|�\}}|j|�}|�||vrt
j|��tjt|j|��}|jst
j|��|j|�ddd�y#1swYyxYwr�)r�r�r�r�rr�rr�r0r1r�r�r�r�)rArBr,r�rr�
dir_dir_entrys       rGr%zMemoryFS.removetreeCs����!�!�$�'��
�Z�Z�	5���|��	�	���!��		5�	5�#(��,��H�i�#�2�2�8�<���'�9�<L�+L��-�-�d�3�3�"�K�K�	�4�3F�3F�u�3M�N�M� �'�'��.�.�t�4�4��)�)�)�4�!	5�	5�	5�s�!C&�BC&�&C/c#��K�|j�|j|�}|j5|j|�}|�t	j
|��|jst	j|��|j�}|�
|\}}|||}|D]?}	tjt|j|	��}
|
j|�����A	ddd�y#1swYyxYw�wr�)r�r�r�r�rr�r�r�r�r0r1r�r�r�)rArBr��pager,rE�	filenames�start�endr��entrys           rG�scandirzMemoryFS.scandirYs�����	
�
�
���!�!�$�'��
�Z�Z�	;��+�+�E�2�I�� ��-�-�d�3�3��#�#��.�.�t�4�4�!���(�I���!�
��s�%�e�C�0�	�!�
;�����I�y�/B�/B�4�/H�I���m�m�z�m�:�:�
;�	;�	;�	;�s�.C0�B*C$�	C0�$C-�)C0c�x�|j|�}|j5t|�\}}|j|�}|�||vrt	j
|��t
jt|j|��}d|vr!|d}d|vr
|d|_
d|vr
|d|_ddd�y#1swYyxYw)Nr�r�r�)r�r�rr�rr�r0r1r�r�r7r8)	rArBr�r,r�rr�resource_entryr�s	         rG�setinfozMemoryFS.setinfoss����!�!�$�'��
�Z�Z�	G�"'��,��H�i�#�2�2�8�<���'�9�<L�+L��-�-�d�3�3�#�[�[��+�5�5�i�@��N��D� ��y�/����(�3:�:�3F�N�0���(�3:�:�3F�N�0�!	G�	G�	G�s�B	B0�0B9rN)NF)FF)�rr�)NN)r�r�r��__doc__r�r+r�rKr�r�rkr�r�r0�
TYPE_CHECKINGr�rrrrr�r&r%r/r2r�r�s@rGr$r$>s�����*"�"������
�E�)���.�!�-�8�$����	���	&�<C�6C�4-�^5�"
�5�2�
�	;�4GrL)>r4�
__future__rrr0r�r2r>�sixr6�collectionsr�	threadingrr�r�_typingr	�baser
r�r�enumsrr
r�rrDrrBrrrr5rrrrrrrrrrrr�array�mmaprr r�r!�subfsr"�TypeVarr#�python_2_unicode_compatible�	RawIOBaser'�objectr�r$rYrLrG�<module>rDs����8�
��	�	�
��#�����$�%���.�.�	���
�
�
�
���%��(��	�����J�	/�B�� � �\0�"�,�,�\0�!�\0�~h��h�V� � �GG�r�GG�!�GGrL

Youez - 2016 - github.com/yon3zu
LinuXploit