a0bi dSrSSKrSSKJr SSKJr SSSS .rSS jrSS jrSS jr S r g)zFdistutils.file_util Utility functions for operating on single files. N)DistutilsFileError)logcopyingz hard linkingzsymbolically linking)NhardsymcSnSn[US5n[ R RU5(a[ R"U5 [US5nURU5nU(dOURU5 M.U(aUR5 U(aUR5 gg![a)n[SRXR55eSnAff=f![a)n[SRXR55eSnAff=f![a)n[SRXR55eSnAff=f![a)n[SRXR55eSnAff=f![a)n[SRXR55eSnAff=f!U(aUR5 U(aUR5 ff=f) a!Copy 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 '{}': {}zcould not read from '{}': {}zcould not write to '{}': {}) openOSErrorrformatstrerrorospathexistsunlinkreadwriteclose)srcdst buffer_sizefsrcfdstebufs ژ/builddir/build/BUILDROOT/alt-python313-setuptools-69.0.2-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/setuptools/_distutils/file_util.py_copy_file_contentsrs D D* XT?D 77>>#    #  T?D  ii ,   3$  JJL  JJL M X$%>%E%Ec::%VW W X  (/66sJJG  $+223 C   (299#zzJ  (188jjI   JJL  JJL s B:$GC0 D&GE.G7FG: C-$C((C--G0 D#:$DD##G& E0$EEG F&$F  FG G$GGG1G9cSSKJn SSKJn Jn Jn Jn [RRU5(d[SU-5e[RRU5(a@Un [RRU[RRU55nO[RRU5n U(a.U"X5(d!US:a[R "SU5 US4$["UnUS:aq[RRU5[RRU5:Xa[R("SXU 5 O[R("SXU5 U(aUS4$US :Xad[RR+U5(a$[RR-X5(d[R."X5 US4$OhUS :Xab[RR+U5(a$[RR-X5(d[R2"X5 US4$[5X5 U(dU(a_[R"U5nU(a[R6"XU X45 U(a[R8"X"X55 US4$![$a ['SU-5ef=f![0a Nf=f) 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 ValueErrorinforsamefilelinkr symlinkrutimechmod)rr preserve_modepreserve_timesupdater3verbosedry_runr!r"r#r$r%diractionsts r copy_filer?FsBR*99 77>>#   BS H   ww}}Sggll3 0 0 56ggooc" eCoo a< II:C @QxJd#!| 77  C BGG$4$4S$9 9 HH]F 5 HH]F 5Qx s##(8(8(B(B !Qx)C s##(8(8(B(B JJs 8O! WWS\  HHSh<6 7  HHS'"+. / 8OU JADHIIJ&   s> KK3K03 L?Lc SSKJnJnJnJnJn SSKn US:a[R"SX5 U(aU$U"U5(d[SU-5eU"U5(a&[RRX"U55nO'U"U5(a[SRX55eU"U"U55(d[SRX55eS n [R"X5 U (a#[%XUS 9 [R&"U5 U$U$![aDn U R upXR":XaS n Sn A NZ[S RXU 55eSn A ff=f![aVn U R up[R&"U5 O![a Of=f[S U<SU<SU<SU <35eSn A ff=f)aMove 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,errnorr1rrrr*rrenamer argsEXDEVr?r)rrr:r;rr(r)r+r,rBcopy_itrnummsgs r move_filerIsA@!| "C- #;; !F!LMM Szzggll3 .  > E Ec O      @ G G Q  G  ##G,  IIcN J3J/ VV  ++ G$077#F   JS  #  $,/c3@  sZD E1 E.*E)E))E.1 G;G  F! G ! F.+G -F..G  Gc[US5nUHnURUS-5 M UR5 g!UR5 f=f)zsCreate a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it. w N)r rr)filenamecontentsflines r write_filerQsD XsAD GGD4K    s <A)i@)rrrNrr)rr) __doc__rerrorsr_logrr.rr?rIrQrrWsP  & @VW 5v hX:z rV