ó
    ^]+jL  ã                   ó<   • S r SSKrSSKrSSKrSSKr " S S5      rg)z(File operations utility - Cross Platformé    Nc                   ód   • \ rS rSrSr\S	S j5       r\S	S j5       r\S
S j5       r\S 5       r	Sr
g)Ú	FileUtilsé   z/Handles file operations with proper permissionsc                 óà   •  [         R                  " U SS9  [        R                  " 5       S:w  a  [         R                  " X5        gg! [
         a  n[        SU  SU 35         SnAgSnAff = f)z9Create directory with proper permissions (platform-aware)T)Úexist_okÚWindowsz$Warning: Could not create directory z: N)ÚosÚmakedirsÚplatformÚsystemÚchmodÚ	ExceptionÚprint)ÚpathÚmodeÚes      Ú-c:\Trade\moneyHeistClient\utils\file_utils.pyÚensure_directoryÚFileUtils.ensure_directory   sc   € ð	FÜ�KŠK˜ tÒ,ô �ŠÓ  IÓ-Ü—’˜Õ$ð .øäó 	FÜÐ8¸¸¸bÀÀÐD×EÑEûð	Fús   ‚AA Á
A-ÁA(Á(A-c                 óò  • [         R                  [        R                  R	                  U5      5        [
        R                  " X5        [        R                  " 5       S:w  aK   [        R                  " X5        [        R                  " [        R                  R	                  U5      U5        [        R                  " 5       S:w  a  [        R                  " 5         [        R                  " S5        g!    NI= f)z4Copy file with specific permissions (platform-aware)r   gš™™™™™¹?N)r   r   r	   r   ÚdirnameÚshutilÚcopy2r   r   r   ÚsyncÚtimeÚsleep)ÚsrcÚdstr   s      r   Úcopy_file_with_permissionsÚ$FileUtils.copy_file_with_permissions   s™   € ô 	×"Ñ"¤2§7¡7§?¡?°3Ó#7Ô8ô 	�Š�SÔô �?Š?Ó 	Ó)ðÜ—’˜Ô#Ü—’œŸ™Ÿ™¨Ó-¨tÔ4ô
 �?Š?Ó 	Ó)Ü�GŠGŒIä�
Š
�3�øðÙús   Á#A
C2 Ã2C6c                 ó~  • [         R                   " 5       nSn[         R                   " 5       U-
  U:  a†  [        R                  R                  U 5      (       d  g[        R                  R	                  U 5      nXC:X  a  US:”  a  gUn[         R
                  " S5        [         R                   " 5       U-
  U:  a  M†  US:„  $ )z(Check if file is fully written and readyéÿÿÿÿFr   Tg      à?)r   r	   r   ÚexistsÚgetsizer   )Ú	file_pathÚtimeoutÚ
start_timeÚ	last_sizeÚcurrent_sizes        r   Úis_file_readyÚFileUtils.is_file_ready.   s�   € ô —Y’Y“[ˆ
Øˆ	ä�iŠi‹k˜JÑ&¨Ó0Ü—7‘7—>‘> )×,Ñ,ØäŸ7™7Ÿ?™?¨9Ó5ˆLØÓ(¨\¸AÓ-=Øà$ˆIÜ�JŠJ�sŒOô �iŠi‹k˜JÑ&¨Õ0ð ˜1‰}Ðó    c                 ó@   • [         R                  R                  U 5      $ )z#Normalize path for current platform)r	   r   Únormpath)r   s    r   Únormalize_pathÚFileUtils.normalize_pathA   s   € ô �w‰w×Ñ Ó%Ð%r,   © N)iÿ  )é   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ústaticmethodr   r   r*   r/   Ú__static_attributes__r1   r,   r   r   r      sU   † Ù9àó	Fó ð	Fð óó ðð, óó ðð$ ñ&ó ó&r,   r   )r7   r	   r   r   r   r   r1   r,   r   Ú<module>r:      s   ðÙ .ã 	Û Û Û ÷<&ò <&r,   