Viewing File: /opt/alt/python35/lib64/python3.5/distutils/__pycache__/file_util.cpython-35.opt-2.pyc



]@sddlZddlmZddlmZddddddiZdddZd
d
ddd
dddZd
dddZddZ	dS)N)DistutilsFileError)logZcopyinghardzhard linkingsymzsymbolically linkingicNCsd}d}zyt|d}Wn>tk
rb}ztd||jfWYdd}~XnXtjj|rytj|Wn>tk
r}ztd||jfWYdd}~XnXyt|d}Wn>tk
r}ztd||jfWYdd}~XnXxy|j|}Wn>tk
rq}ztd||jfWYdd}~XnX|syPy|j	|Wqtk
r}ztd||jfWYdd}~XqXqWWd|r|j
|r|j
XdS)Nrbzcould not open '%s': %szcould not delete '%s': %swbzcould not create '%s': %szcould not read from '%s': %szcould not write to '%s': %s)openOSErrorrstrerrorospathexistsunlinkreadwriteclose)srcdstZbuffer_sizefsrcfdstebufr./opt/alt/python35/lib64/python3.5/file_util.py_copy_file_contentssF	,)))1
rcCsddlm}ddlm}	m}
m}m}tjj	|sTt
d|tjj|r|}
tjj|tjj
|}ntjj|}
|r|||r|dkrtjd||dfSyt|}Wn"tk
rtd|YnX|dkrptjj
|tjj
|krZtjd|||
ntjd||||r|dfS|d	krtjj|otjj||s6ytj|||dfSWq6tk
rYq6XnM|d
kr6tjj|otjj||s6tj|||dfSt|||sO|rtj|}|rtj|||	||
f|rtj|||||dfS)Nr)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)Zdistutils.dep_utilrstatrrr r!rr
isfilerisdirjoinbasenamedirnamerdebug_copy_actionKeyError
ValueErrorinforsamefilelinkr
symlinkrutimechmod)rrZ
preserve_modeZpreserve_timesupdater.verbosedry_runrrrr r!diractionstrrr	copy_fileCsT!"
$

$
'
'

r8c(Csddlm}m}m}m}m}ddl}	|dkrStjd|||r]|S||syt	d|||rt
jj|||}n"||rt	d||f|||st	d||fd}
yt
j
||Wnetk
rn}zE|j\}}
||	jkrCd	}
nt	d
|||
fWYdd}~XnX|
rt||d|yt
j|Wnvtk
r}zV|j\}}
yt
j|Wntk
rYnXt	d||||
fWYdd}~XnX|S)
Nr)rr#r$r&r'rzmoving %s -> %sz#can't move '%s': not a regular filez0can't move '%s': destination '%s' already existsz2can't move '%s': destination '%s' not a valid pathFTzcouldn't move '%s' to '%s': %sr3zAcouldn't move '%s' to '%s' by copy/delete: delete '%s' failed: %s)Zos.pathrr#r$r&r'errnorr,rrr
r%renamer
argsZEXDEVr8r)rrr3r4rr#r$r&r'r9Zcopy_itrnummsgrrr	move_filesR(	)
)r>c
CsGt|d}z&x|D]}|j|dqWWd|jXdS)Nw
)r	rr)filenamecontentsflinerrr
write_files

rEi@)
rZdistutils.errorsrZ	distutilsrr)rr8r>rErrrr<module>s3	c=
Back to Directory File Manager