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

��obnF��h�dZddlmZmZddlZddlZddlmZddlm	Z	ddl
mZmZm
Z
mZddlmZdd	lmZej&rdd
lmZmZmZmZddlmZeeeeegefZ				dd�Z				dd
�Z					dd�Z	dd�Z	dd�Z 	dd�Z!		dd�Z"			dd�Z#				dd�Z$				dd�Z%				dd�Z&d�Z'd�Z(y)z6Functions for copying resources *between* filesystem.
�)�print_function�unicode_literalsN�)�ResourceNotFound)�	manage_fs)�abspath�combine�frombase�normpath)�is_thread_safe)�Walker)�Callable�Optional�Text�Union)�FSc	�&�t||d||||��S)a@Copy the contents of one filesystem to another.

    Arguments:
        src_fs (FS or str): Source filesystem (URL or instance).
        dst_fs (FS or str): Destination filesystem (URL or instance).
        walker (~fs.walk.Walker, optional): A walker object that will be
            used to scan for files in ``src_fs``. Set this if you only want
            to consider a sub-set of the resources in ``src_fs``.
        on_copy (callable): A function callback called after a single file copy
            is executed. Expected signature is ``(src_fs, src_path, dst_fs,
            dst_path)``.
        workers (int): Use `worker` threads to copy data, or ``0`` (default) for
            a single-threaded copy.
        preserve_time (bool): If `True`, try to preserve mtime of the
            resources (defaults to `False`).

    �always��
preserve_time)�
copy_fs_if��src_fs�dst_fs�walker�on_copy�workersrs      �)/usr/lib/python3/dist-packages/fs/copy.py�copy_fsrs ��4����&�'�7�-���c	�Z�tjdt�t||d||||��S)z�Copy the contents of one filesystem to another, checking times.

    .. deprecated:: 2.5.0
       Use `~fs.copy.copy_fs_if` with ``condition="newer"`` instead.

    z7copy_fs_if_newer is deprecated. Use copy_fs_if instead.�newerr)�warnings�warn�DeprecationWarningrrs      r�copy_fs_if_newerr&7s4��
�M�M�A�CU��������'���r c�*�t|d|d|||||��	S)aCopy the contents of one filesystem to another, depending on a condition.

    Arguments:
        src_fs (FS or str): Source filesystem (URL or instance).
        dst_fs (FS or str): Destination filesystem (URL or instance).
        condition (str): Name of the condition to check for each file.
        walker (~fs.walk.Walker, optional): A walker object that will be
            used to scan for files in ``src_fs``. Set this if you only want
            to consider a sub-set of the resources in ``src_fs``.
        on_copy (callable):A function callback called after a single file copy
            is executed. Expected signature is ``(src_fs, src_path, dst_fs,
            dst_path)``.
        workers (int): Use ``worker`` threads to copy data, or ``0`` (default)
            for a single-threaded copy.
        preserve_time (bool): If `True`, try to preserve mtime of the
            resources (defaults to `False`).

    See Also:
        `~fs.copy.copy_file_if` for the full list of supported values for the
        ``condition`` argument.

    �/)rrrr��copy_dir_if)rr�	conditionrrrrs       rrrNs-��@���������#�
�
r c�&�t||||d|��y)aCopy a file from one filesystem to another.

    If the destination exists, and is a file, it will be first truncated.

    Arguments:
        src_fs (FS or str): Source filesystem (instance or URL).
        src_path (str): Path to a file on the source filesystem.
        dst_fs (FS or str): Destination filesystem (instance or URL).
        dst_path (str): Path to a file on the destination filesystem.
        preserve_time (bool): If `True`, try to preserve mtime of the
            resource (defaults to `False`).

    rrN)�copy_file_if�r�src_pathr�dst_pathrs     r�	copy_filer1{s��*���&�(�H�M�r c�X�tjdt�t||||d|��S)z�Copy a file from one filesystem to another, checking times.

    .. deprecated:: 2.5.0
       Use `~fs.copy.copy_file_if` with ``condition="newer"`` instead.

    z;copy_file_if_newer is deprecated. Use copy_file_if instead.r"r)r#r$r%r-r.s     r�copy_file_if_newerr3�s2��
�M�M�E������&�(�G�=��r c
���t|d��5}t|d��5}t|||||�}|rt|||||d��|cddd�cddd�S#1swYnxYw	ddd�y#1swYyxYw)a�Copy a file from one filesystem to another, depending on a condition.

    Depending on the value of ``condition``, certain requirements must
    be fulfilled for a file to be copied to ``dst_fs``. The following
    values are supported:

    ``"always"``
        The source file is always copied.
    ``"newer"``
        The last modification time of the source file must be newer than that
        of the destination file. If either file has no modification time, the
        copy is performed always.
    ``"older"``
        The last modification time of the source file must be older than that
        of the destination file. If either file has no modification time, the
        copy is performed always.
    ``"exists"``
        The source file is only copied if a file of the same path already
        exists in ``dst_fs``.
    ``"not_exists"``
        The source file is only copied if no file of the same path already
        exists in ``dst_fs``.

    Arguments:
        src_fs (FS or str): Source filesystem (instance or URL).
        src_path (str): Path to a file on the source filesystem.
        dst_fs (FS or str): Destination filesystem (instance or URL).
        dst_path (str): Path to a file on the destination filesystem.
        condition (str): Name of the condition to check for each file.
        preserve_time (bool): If `True`, try to preserve mtime of the
            resource (defaults to `False`).

    Returns:
        bool: `True` if the file copy was executed, `False` otherwise.

    F��	writeableT��create)r�lockN)r�_copy_is_necessary�copy_file_internal)	rr/rr0r+r�_src_fs�_dst_fs�do_copys	         rr-r-�s���Z
�6�U�	+��w�
�v�d�
+�
	�w�(���7�H�i��G��"�����"/��
��
	�
	���
	�
	��
	����s"�A)�$A�	A)�A	�A)�)A2c�
��������ur�j��d���y�����fd�}|r:�j�5�j�5|�ddd�ddd�y|�y#1swY�xYw#1swYyxYw)a�Copy a file at low level, without calling `manage_fs` or locking.

    If the destination exists, and is a file, it will be first truncated.

    This method exists to optimize copying in loops. In general you
    should prefer `copy_file`.

    Arguments:
        src_fs (FS): Source filesystem.
        src_path (str): Path to a file on the source filesystem.
        dst_fs (FS): Destination filesystem.
        dst_path (str): Path to a file on the destination filesystem.
        preserve_time (bool): If `True`, try to preserve mtime of the
            resource (defaults to `False`).
        lock (bool): Lock both filesystems before copying.

    T)�	overwriterNc�.���j��r.�j�d�5}�j�|�ddd�n,�j��5}�j�|�ddd��rt	�����yy#1swY�xYw#1swY�'xYw)N�w)�
hassyspath�openbin�download�upload�copy_modified_time)�
write_file�	read_filerr0rrr/s  �����r�_copy_lockedz(copy_file_internal.<locals>._copy_locked
s�������X�&�����#�.�
6�*�����*�5�
6�
6�����)�
3�Y��
�
�h�	�2�
3���v�x���B��

6�
6��
3�
3�s�A?�B�?B�B)�copyr9)rr/rr0rr9rJs`````  rr;r;�s����4���	���H�h�$�m��T��	C�	C��
�[�[�]�	�F�K�K�M�	��N�	�	�	�	��	�	��	�	�s#�A9�A-�A9�-A6	�2A9�9Bc���|xs
t�}t|�5}t|d��5}|j�5|j�5|j|d��|j	||�D])}|jt
|t||��d���+	ddd�ddd�ddd�ddd�y#1swY�"xYw#1swY�&xYw#1swY�*xYw#1swYyxYw)apCopy directories (but not files) from ``src_fs`` to ``dst_fs``.

    Arguments:
        src_fs (FS or str): Source filesystem (instance or URL).
        dst_fs (FS or str): Destination filesystem (instance or URL).
        walker (~fs.walk.Walker, optional): A walker object that will be
            used to scan for files in ``src_fs``. Set this if you only
            want to consider a sub-set of the resources in ``src_fs``.
        src_root (str): Path of the base directory to consider as the root
            of the tree structure to copy.
        dst_root (str): Path to the target root of the tree structure.

    Tr7)�recreateN)r
rr9�makedirs�dirs�makedirr	r
)rrr�src_root�dst_rootr<r=�dir_paths        r�copy_structurerTs���*�
�v�x�F�	�6�	��g�
�v�d�
+�	�w�����
�����
�� � ��D� �9� &���G�X� >��H��O�O���(�8�X�*F�G�RV�$���
�
�	���
�
��
�
��	�	����sR�C"�C�C
�
AB>	�C
�%C�-C"�>C
�C
�
C�C�C	�C"�"C+c�,�t||||d||||��	y)a�Copy a directory from one filesystem to another.

    Arguments:
        src_fs (FS or str): Source filesystem (instance or URL).
        src_path (str): Path to a directory on the source filesystem.
        dst_fs (FS or str): Destination filesystem (instance or URL).
        dst_path (str): Path to a directory on the destination filesystem.
        walker (~fs.walk.Walker, optional): A walker object that will be
            used to scan for files in ``src_fs``. Set this if you only
            want to consider a sub-set of the resources in ``src_fs``.
        on_copy (callable, optional):  A function callback called after
            a single file copy is executed. Expected signature is
            ``(src_fs, src_path, dst_fs, dst_path)``.
        workers (int): Use ``worker`` threads to copy data, or ``0`` (default) for
            a single-threaded copy.
        preserve_time (bool): If `True`, try to preserve mtime of the
            resources (defaults to `False`).

    rrNr)�rr/rr0rrrrs        r�copy_dirrW<s'��<���������#�
r c�`�tjdt�t||||d||||��	y)z�Copy a directory from one filesystem to another, checking times.

    .. deprecated:: 2.5.0
       Use `~fs.copy.copy_dir_if` with ``condition="newer"`` instead.

    z9copy_dir_if_newer is deprecated. Use copy_dir_if instead.r"rN)r#r$r%r*rVs        r�copy_dir_if_newerrYgs;��"
�M�M�C�EW�����������#�
r c	
���|xsd�}|xs
t�}tt|��}	tt|��}
ddlm}t|||||�t
|d��5}t
|d��5}
|j�5|
j�5t||
�}||r|nd|�	�5}|j||	�D]G}t|
t|	|��}t|||
||�s�)|j|||
|�||||
|��I	d
d
d
�d
d
d
�d
d
d
�d
d
d
�d
d
d
�y
#1swY�*xYw#1swY�.xYw#1swY�2xYw#1swY�6xYw#1swYy
xYw)a�Copy a directory from one filesystem to another, depending on a condition.

    Arguments:
        src_fs (FS or str): Source filesystem (instance or URL).
        src_path (str): Path to a directory on the source filesystem.
        dst_fs (FS or str): Destination filesystem (instance or URL).
        dst_path (str): Path to a directory on the destination filesystem.
        condition (str): Name of the condition to check for each file.
        walker (~fs.walk.Walker, optional): A walker object that will be
            used to scan for files in ``src_fs``. Set this if you only want
            to consider a sub-set of the resources in ``src_fs``.
        on_copy (callable):A function callback called after a single file copy
            is executed. Expected signature is ``(src_fs, src_path, dst_fs,
            dst_path)``.
        workers (int): Use ``worker`` threads to copy data, or ``0`` (default) for
            a single-threaded copy.
        preserve_time (bool): If `True`, try to preserve mtime of the
            resources (defaults to `False`).

    See Also:
        `~fs.copy.copy_file_if` for the full list of supported values for the
        ``condition`` argument.

    c��y)N�)�argss r�<lambda>zcopy_dir_if.<locals>.<lambda>�s�r r)�CopierFr5Tr7r)�num_workersrN)r
rr�_bulkr_rTrr9r�filesr	r
r:rK)rr/rr0r+rrrr�	_src_path�	_dst_pathr_r<r=�_thread_safe�copierrS�	copy_paths                  rr*r*�s���H�-�,�G�
�
�v�x�F����*�+�I����*�+�I���6�6�6�8�X�>�	�6�U�	+�G�w�	��t�9�G�	�
�\�\�^�	G�W�\�\�^�	G�)�'�7�;�L��'3�G��-��	
G�� &���W�i� @�G�H� '�	�8�I�x�3P� Q�I�)���7�I�y�����G�X�w�	�J����7�I�F�
G�	
G�	G�	G�G�G�G�
	
G�	
G��	G�	G��	G�	G��G�G��G�G�sr� E"�.E�?E
�D>	�+;D2�'!D2�	D>	�E
�E�!E"�2D;�7D>	�>E
�E
�
E�E�E	�E"�"E+c��|dk(ry|dk(r4	|j|�}|j|�}|duxs|duxs||kDS|dk(r4	|j|�}|j|�}|duxs|duxs||kS|dk(r|j|�S|dk(r|j|�Stdj	|���#t$rYywxYw#t$rYywxYw)NrTr"�older�exists�
not_existsz!{} is not a valid copy condition.)�getmodifiedrrj�
ValueError�format)rr/rr0r+�src_modified�dst_modifieds       rr:r:�s0���H���	�g�	�
	�!�-�-�h�7�L�!�-�-�h�7�L�
��$�/��4�'�/��,�.�
�
�g�	�
	�!�-�-�h�7�L�!�-�-�h�7�L�
��$�/��4�'�/��,�.�
�
�h�	��}�}�X�&�&�	�l�	"��=�=��*�*�*��<�C�C�I�N�O�O��; �	��	�� �	��	�s#�"C�"C�	C�C�	C�Cc�@�d}t|d��5}t|d��5}|j||�}|jjdi�}i}	dD]}
|
|vs�||
|	|
<�|j	|d|	i�ddd�ddd�y#1swY�xYw#1swYyxYw)	acCopy modified time metadata from one file to another.

    Arguments:
        src_fs (FS or str): Source filesystem (instance or URL).
        src_path (str): Path to a directory on the source filesystem.
        dst_fs (FS or str): Destination filesystem (instance or URL).
        dst_path (str): Path to a directory on the destination filesystem.

    )�detailsFr5Tr7rr)�metadata_changed�modifiedN)r�getinfo�raw�get�setinfo)rr/rr0�
namespacesr<r=�src_meta�src_details�dst_details�values           rrGrG�s��� �J�	�6�U�	+�@�w�
�v�d�
+�	@�w����x��<�H�"�,�,�*�*�9�b�9�K��K�9�
<���K�'�)4�U�);�K��&�
<�
�O�O�H�y�+�&>�?�	@�@�@�	@�	@��@�@�s(�B�:B�B�7B�B	�
B�B)NNrF)rNNrF)F)FF)Nr(r())�__doc__�
__future__rr�typingr#�errorsr�openerr�pathrr	r
r�toolsr�walkr
�
TYPE_CHECKINGrrrr�baser�object�_OnCopyrr&rr1r3r-r;rTrWrYr*r:rGr\r r�<module>r�s���8�
��$��6�6�!��	���6�6����D�"�d�+�V�3�4�G���
��
�D��
��
�4���
��*�d��>��:�
;�F�	�
/�j�
�
��J��
��(�`��
���N��
��;G�|-P�`@r 

Youez - 2016 - github.com/yon3zu
LinuXploit