b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 172.67.192.52 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 /
Filename/usr/lib64/python2.6/shutil.pyo
Size9.33 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 05:27
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc@s8dZddkZddkZddkZddklZddkZddkZdddddd d
d d d
g
Zd
e fd��YZ
ye Wne j
o
dZ nXdd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zedd�Zedd�Zd�Zd�Zd�ZdS(s�Utility functions for copying files and directory trees.

XXX The functions here don't copy the resource fork or other metadata on Mac.

iÿÿÿÿN(tabspatht copyfileobjtcopyfiletcopymodetcopystattcopytcopy2tcopytreetmovetrmtreetErrorcBseZRS((t__name__t
__module__(((s/usr/lib64/python2.6/shutil.pyR
siicCs2x+|i|�}|pPn|i|�qdS(s=copy data from file-like object fsrc to file-like object fdstN(treadtwrite(tfsrctfdsttlengthtbuf((s/usr/lib64/python2.6/shutil.pyRs
cCsttid�o2ytii||�SWqEtj
otSXntiitii|��tiitii|��jS(Ntsamefile(thasattrtostpathRtOSErrortFalsetnormcaseR(tsrctdst((s/usr/lib64/python2.6/shutil.pyt _samefile!s
c Cs�t||�otd||f��nt|d�ii�}zF|~}t|d�ii�}z|~}t||�WdQXWdQXdS(sCopy data from src to dsts`%s` and `%s` are the same filetrbtwbN(RR
topent__exit__t __enter__R(RRt_[1]Rt_[2]R((s/usr/lib64/python2.6/shutil.pyR-s
&&cCsIttd�o5ti|�}ti|i�}ti||�ndS(sCopy mode bits from src to dsttchmodN(RRtstattS_IMODEtst_modeR$(RRtsttmode((s/usr/lib64/python2.6/shutil.pyR6scCs÷ti|�}ti|i�}ttd�o ti||i|if�nttd�oti||�nttd�ont|d�o^yti ||i
�Wqót j
o4}tt d� p|i t i
jo�qïqóXndS(sCCopy all stat info (mode bits, atime, mtime, flags) from src to dsttutimeR$tchflagstst_flagst
EOPNOTSUPPN(RR%R&R'RR*tst_atimetst_mtimeR$R+R,RterrnoR-(RRR(R)twhy((s/usr/lib64/python2.6/shutil.pyR=s  $cCsVtii|�o%tii|tii|��}nt||�t||�dS(sVCopy data and mode bits ("cp src dst").

The destination may be a directory.

N(RRtisdirtjointbasenameRR(RR((s/usr/lib64/python2.6/shutil.pyRLs%
cCsVtii|�o%tii|tii|��}nt||�t||�dS(s]Copy data and all stat info ("cp -p src dst").

The destination may be a directory.

N(RRR2R3R4RR(RR((s/usr/lib64/python2.6/shutil.pyRWs%
cs�fd�}|S(s�Function that can be used as copytree() ignore parameter.

Patterns is a sequence of glob-style patterns
that are used to exclude filescs:g}x'�D]}|iti||��q
Wt|�S(N(textendtfnmatchtfiltertset(Rtnamest
ignored_namestpattern(tpatterns(s/usr/lib64/python2.6/shutil.pyt_ignore_patternsgs
((R<R=((R<s/usr/lib64/python2.6/shutil.pytignore_patternsbsc
Csõti|�}|dj o|||�}n
t�}ti|�g}x)|D]!}||joqRntii||�}tii||�} yx|o6tii|�o#ti|�}
ti |
| �n8tii
|�ot || ||�nt || �WqRt
tifj
o%} |i|| t| �f�qRtj
o} |i| id�qRXqRWyt||�WnRtj
oF} tdj ot| t�oqÝ|i||t| �f�nX|o
t|�ndS(sÇRecursively copy a directory tree using copy2().

The destination directory must not already exist.
If exception(s) occur, an Error is raised with a list of reasons.

If the optional symlinks flag is true, symbolic links in the
source tree result in symbolic links in the destination tree; if
it is false, the contents of the files pointed to by symbolic
links are copied.

The optional ignore argument is a callable. If given, it
is called with the `src` parameter, which is the directory
being visited by copytree(), and `names` which is the list of
`src` contents, as returned by os.listdir():

callable(src, names) -> ignored_names

Since copytree() is called recursively, the callable will be
called once for each directory that is copied. It returns a
list of names relative to the `src` directory that should
not be copied.

XXX Consider this example code rather than the ultimate tool.

iN(RtlistdirtNoneR8tmakedirsRR3tislinktreadlinktsymlinkR2RRtIOErrorterrortappendtstrR
R5targsRRt WindowsErrort
isinstance(
RRtsymlinkstignoreR9R:terrorstnametsrcnametdstnametlinktoR1terr((s/usr/lib64/python2.6/shutil.pyRns>
 

 !cCsà|o
d�}n|djo
d�}ny'tii|�otd��nWn0tj
o$|tii|ti��dSXg}yti|�}Wn1tij
o"}|ti|ti��nXxÁ|D]¹}tii ||�}yti
|�i }Wntij
o
d}nXt i
|�ot|||�qÜyti|�WqÜtij
o"}|ti|ti��qÜXqÜWyti|�Wn/tij
o |ti|ti��nXdS(sÁRecursively delete a directory tree.

If ignore_errors is set, errors are ignored; otherwise, if onerror
is set, it is called to handle the error with arguments (func,
path, exc_info) where func is os.listdir, os.remove, or os.rmdir;
path is the argument to that function that caused it to fail; and
exc_info is a tuple returned by sys.exc_info(). If ignore_errors
is false and onerror is None, an exception is raised.

cWsdS(N((RI((s/usr/lib64/python2.6/shutil.pytonerror»scWs�dS(N((RI((s/usr/lib64/python2.6/shutil.pyRT¾ss%Cannot call rmtree on a symbolic linkNi(R@RRRBRtsystexc_infoR?RFR3tlstatR'R%tS_ISDIRR tremovetrmdir(Rt
ignore_errorsRTR9RSROtfullnameR)((s/usr/lib64/python2.6/shutil.pyR ¯s@ 


 "cCstii|itii��S(N(RRR4trstriptsep(R((s/usr/lib64/python2.6/shutil.pyt _basenameàscCsÿ|}tii|�oCtii|t|��}tii|�otd|�q\nyti||�Wn�tj
o|tii|�oHt ||�otd||f�nt
||dt �t |�qût
||�ti|�nXdS(s�Recursively move a file or directory to another location. This is
similar to the Unix "mv" command.

If the destination is a directory or a symlink to a directory, the source
is moved inside the directory. The destination path must not already
exist.

If the destination already exists but is not a directory, it may be
overwritten depending on os.rename() semantics.

If the destination is on our current filesystem, then rename() is used.
Otherwise, src is copied to the destination and then removed.
A lot more could be done here... A look at a mv.c shows a lot of
the issues this implementation glosses over.

s$Destination path '%s' already existss.Cannot move a directory '%s' into itself '%s'.RLN(RRR2R3R_texistsR
trenameRt destinsrcRtTrueR Rtunlink(RRtreal_dst((s/usr/lib64/python2.6/shutil.pyRås
cCsyt|�}t|�}|itii�p|tii7}n|itii�p|tii7}n|i|�S(N(RtendswithRRR^t
startswith(RR((s/usr/lib64/python2.6/shutil.pyRbs  i@(t__doc__RRUR%tos.pathRR6R0t__all__tEnvironmentErrorR
RJt NameErrorR@RRRRRRRR>RRR R_RRb(((s/usr/lib64/python2.6/shutil.pyt<module>s4          A1  "