ef `dZddlZddlmZddlmZdddd Zdd Z dd Zdd Z dZ dS)zFdistutils.file_util Utility functions for operating on single files. N)DistutilsFileError)logcopyingz hard linkingzsymbolically linking)Nhardsym@c.d}d} t|d}n:#t$r-}td||jd}~wwxYwt j|rP t j|n:#t$r-}td||jd}~wwxYw t|d}n:#t$r-}td||jd}~wwxYw | |}n:#t$r-}td||jd}~wwxYw|snR | |n:#t$r-}td ||jd}~wwxYw |r| |r| dSdS#|r| |r| wwxYw) a5Copy the file 'src' to 'dst'; both must be filenames. Any error opening either file, reading from 'src', or writing to 'dst', raises DistutilsFileError. Data is read/written in chunks of 'buffer_size' bytes (default 16k). No attempt is made to handle anything apart from regular files. Nrbzcould not open '{}': {}zcould not delete '{}': {}wbzcould not create '{}': {}Tzcould not read from '{}': {}zcould not write to '{}': {}) openOSErrorrformatstrerrorospathexistsunlinkreadwriteclose)srcdst buffer_sizefsrcfdstebufs /builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/setuptools/_distutils/file_util.py_copy_file_contentsr s D D* XT??DD X X X$%>%E%Ec1:%V%VWW W X 7>>#     #   (/66sAJGG   T??DD   $+223 CC     ii ,,   (299#qzJJ     3   (188ajII     JJLLL   JJLLLLL     JJLLL   JJLLLL sG% A(A  A"G%2BG% B>(B99B>>G%CG% D (DD  G%D%$G%% E/(EEG%#E98G%9 F0(F++F00G%%/Hcddlm}ddlm} m} m} m} tj |std|ztj |r@|} tj |tj |}ntj|} |r+|||s|dkrtjd||dfS t"|}n #t$$rt'd|zwxYw|dkrotj |tj |krtjd||| ntjd||||r|dfS|d krjtj|r tj||s* tj|||dfS#t0$rYncwxYwn^|d krXtj|r tj||stj|||dfSt5|||s|r_tj|}|r#tj||| || f|r$tj|| || |dfS) aCopy a file 'src' to 'dst'. If 'dst' is a directory, then 'src' is copied there with the same name; otherwise, it must be a filename. (If the file exists, it will be ruthlessly clobbered.) If 'preserve_mode' is true (the default), the file's mode (type and permission bits, or whatever is analogous on the current platform) is copied. If 'preserve_times' is true (the default), the last-modified and last-access times are copied as well. If 'update' is true, 'src' will only be copied if 'dst' does not exist, or if 'dst' does exist but is older than 'src'. 'link' allows you to make hard links (os.link) or symbolic links (os.symlink) instead of copying: set it to "hard" or "sym"; if it is None (the default), files are copied. Don't set 'link' on systems that don't support it: 'copy_file()' doesn't check if hard or symbolic linking is available. If hardlink fails, falls back to _copy_file_contents(). Under Mac OS, uses the native file copy function in macostools; on other systems, uses '_copy_file_contents()' to copy file contents. Return a tuple (dest_name, copied): 'dest_name' is the actual name of the output file, and 'copied' is true if the file was copied (or would have been copied, if 'dry_run' true). r)newer)ST_ATIMEST_MTIMEST_MODES_IMODEz4can't copy '%s': doesn't exist or not a regular filerz"not copying %s (output up-to-date)z&invalid value '%s' for 'link' argumentz %s %s -> %srr)distutils._modifiedr"statr#r$r%r&rrisfilerisdirjoinbasenamedirnamerdebug _copy_actionKeyError ValueErrorinforsamefilelinkrsymlinkr utimechmod)rr preserve_modepreserve_timesupdater4verbosedry_runr"r#r$r%r&diractionsts r copy_filer@FsR*)))))999999999999 7>>#    BS H    w}}S#gll3 0 0 5 566gooc"" eeCoo a<< I:C @ @ @QxJd# JJJADHIIIJ!|| 7  C BG$4$4S$9$9 9 9 H]FC 5 5 5 5 H]FC 5 5 5Qx s## (8(8c(B(B  S!!!Qx        s## (8(8c(B(B  JsC 8OS!!!00 WS\\  8 HS2h<H6 7 7 7  0 HS''"W+.. / / / 8Os0 C>>DG88 HHc ddlm}m}m}m}m}ddl} |dkrtjd|||r|S||std|z||r*tj |||}n.||r#td |||||s#td ||d } tj||nS#t$rF} | j\} } | | jkrd } n$td ||| Yd} ~ nd} ~ wwxYw| rt%|||  tj|n]#t$rP} | j\} } tj|n#t$rYnwxYwtd |d|d|d| d} ~ wwxYw|S)a%Move a file 'src' to 'dst'. If 'dst' is a directory, the file will be moved into it with the same name; otherwise, 'src' is just renamed to 'dst'. Return the new full name of the file. Handles cross-device moves on Unix using 'copy_file()'. What about other systems??? r)rr)r*r,r-Nrzmoving %s -> %sz#can't move '%s': not a regular filez0can't move '{}': destination '{}' already existsz2can't move '{}': destination '{}' not a valid pathFTzcouldn't move '{}' to '{}': {})r;zcouldn't move 'z' to 'z' by copy/delete: delete 'z ' failed: )os.pathrr)r*r,r-errnorr2rrrr+rrenamerargsEXDEVr@r)rrr;r<rr)r*r,r-rCcopy_itrnummsgs r move_filerJsA@@@@@@@@@@@@@LLL!|| "C--- 6#;;N !F!LMMM uSzz gll3 ..   > E Ec3 O O    5    @ G GS Q Q   G  #s V c %+  GG$077S#FF  GGGG #sG,,,,  IcNNNN   JS#  #    $$,/CCccc33@   JsT-D E rXs  &&&&&& @VWW 5555v hhhhX::::z     rW