
    hg                     >    S r SSKrSSKJrJr  SSKJr  S/r SS jrg)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_safec           
          [         R                  R                  X5      (       a  g U(       d9  [         R                  " U[         R
                  5      (       a  [        SU S35      e [         R                  " X5        g! [         a     Ndf = f! [         a     Of = f[        U S5       n[         R                  " U[         R                  [         R                  -  [        [         SS5      -  U(       d  [         R                  OS-  5      n [        R                  " U[        R                  5        SnUS:w  a/  UR!                  U5      n[         R"                  " XV5        US:w  a  M/  [        R$                  " U5        [         R&                  " U5        O1! [        R$                  " U5        [         R&                  " U5        f = f SSS5        O! , (       d  f       O= f [)        X5        O-! [*         a      [-        X5         O! [*         a      Of = ff = f [         R.                  " U 5        g! [*         a  n[        USS5      S	:w  a  e  SnAgSnAff = f)
a=  
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``.
NzDestination file z% exists and allow_overwrite is False.rbO_BINARYr       winerror    )ospathsamefileOSErroraccessF_OKFileExistsErrorrename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es           H/var/www/html/env/lib/python3.13/site-packages/django/core/files/move.pyr   r      s   77M99 :
 ryy@@.ST
 	

		-/     	 
mT	"hWW**"j!,- %4299<
	JJr5==) M3& (j 9+  3& LLHHRL LLHHRLL' 
#	"	"*
. 
	]2 		
		-  
 1j!$* +s   $B  )B  
BB
BB,A#GAF,-G.GG
G"&G2 2
H=H


HHHH H7 7
III)i   F)	__doc__r   shutilr   r   django.core.filesr   __all__r    r
   r*   <module>r0      s*    
 % #
 INJr
   