HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
User: sport3497 (1034)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberCP/lib/python3.10/site-packages/django/core/files/__pycache__/move.cpython-310.pyc
o

�h��@sFdZddlZddlmZmZddlmZdgZdd�Z		dd
d�Z	dS)z�
Move a file in the safest way possible::

    >>> from django.core.files.move import file_move_safe
    >>> file_move_safe("/tmp/old_file", "/tmp/new_file")
�N)�copymode�copystat)�locks�file_move_safecCsZttjd�rztj�||�WStyYdSwtj�tj�|��tj�tj�|��kS)N�samefileF)�hasattr�os�pathr�OSError�normcase�abspath)�src�dst�r�I/usr/local/CyberCP/lib/python3.10/site-packages/django/core/files/move.py�	_samefiles�
�r�FcCs�t||�rdSz|st�|tj�rtd|��t�||�WdSty(Ynwt|d��S}t�|tjtj	Bt
tdd�B|sBtjndB�}z(t�
|tj�d}|dkrc|�|�}t�||�|dksTWt�|�t�|�nt�|�t�|�wWd�n1s�wYzt||�Wnty�zt||�Wn	ty�YnwYnwzt�|�WdSty�}zt
|dd�dkrĂWYd}~dSd}~ww)	aU
    Move a file from one location to another in the safest way possible.

    First, try ``os.rename``, which is simple but will break across filesystems.
    If that fails, stream manually from one file to another in pure Python.

    If the destination file exists and ``allow_overwrite`` is ``False``, raise
    ``FileExistsError``.
    Nz8Destination file %s exists and allow_overwrite is False.�rb�O_BINARYr��winerror� )rr�access�F_OK�FileExistsError�renamer
�open�O_WRONLY�O_CREAT�getattr�O_EXCLr�lock�LOCK_EX�read�write�unlock�closer�PermissionErrorr�remove)�
old_file_name�
new_file_name�
chunk_size�allow_overwrite�old_file�fd�
current_chunk�errrrsp

����
���	
��

�����
���)rF)
�__doc__r�shutilrr�django.core.filesr�__all__rrrrrr�<module>s�