³ò <¯bCc#@s¶dZddkZddkTdddddd d d d d ddddddddddddddddddd d!d"d#d$g!Zd%Zd&Zd'Zd%Zd(Zd%Z dZ d)Z d*„Z d+„Zd,„Zd-„Zd.„Zd/„Zd0„Zd1„Zd2„Zd3„Zd4„Zd5„Zd6„Zd7„Zd8„Zd9„Zd:„Zd;„Zd<„Zd=„Z d>„Z!d?e"fd@„ƒYZ#dA„Z$dB„Z%dC„Z&dD„Z'e(Z)dS(Es7Pathname and path-related operations for the Macintosh.iÿÿÿÿN(t*tnormcasetisabstjoint splitdrivetsplittsplitexttbasenametdirnamet commonprefixtgetsizetgetmtimetgetatimetgetctimetislinktexiststlexiststisdirtisfiletwalkt expandusert expandvarstnormpathtabspathtcurdirtpardirtseptpathseptdefpathtaltseptextseptdevnulltrealpathtsupports_unicode_filenamest:s::t.s sDev:NullcCs |iƒS(N(tlower(tpath((s macpath.pycRscCsd|jo|ddjS(søReturn true if a path is absolute. On the Mac, relative paths begin with a colon, but as a special case, paths with no colons at all are also relative. Anything else is absolute (the string up to the first colon is the volume name).R"i((ts((s macpath.pycRscGs |}x“|D]‹}| p t|ƒo |}q n|d djo|d}nd|jod|}n|ddjo|d}n||}q W|S(NiR"iÿÿÿÿ(R(R&tpR%tt((s macpath.pycR's cCs¢d|jod|fSnd}x9tt|ƒƒD]%}||djo|d}q4q4W||d ||}}|od|jo|d}n||fS(sßSplit a pathname into two parts: the directory leading up to the final bit, and the basename (the filename, without colons, in that directory). The result (s, t) is such that join(s, t) yields the original argument.R"tii(trangetlen(R&tcolontiR%tfile((s macpath.pycR7s cCsI|idƒ}||idƒjo|dfSn|| ||fSdS(sÒSplit a path into root and extension. The extension is everything starting at the last dot in the last pathname component; the root is everything before that. It is always true that root + ext == p.R#R"R)N(trfind(R'R-((s macpath.pycRFscCs d|fS(s@Split a pathname into a drive specification and the rest of the path. Useful on DOS/Windows/NT; on the Mac, the drive is always empty (don't use the volume name -- it doesn't have the same syntactic and semantic oddities as DOS drive letters, such as there being a separate current directory per drive).R)((R'((s macpath.pycRSscCst|ƒdS(Ni(R(R&((s macpath.pycR_scCst|ƒdS(Ni(R(R&((s macpath.pycR`scCsBt|ƒptSnt|ƒ}t|ƒdjo|ddjS(NiiR)(RtFalseRR+(R&t components((s macpath.pyctismountbs  cCs=yti|ƒ}Wntij o dSnXt|iƒS(s<Return true if the pathname refers to an existing directory.i(toststatterrortS_ISDIRtst_mode(R&tst((s macpath.pycRhs  cCsti|ƒiS(s1Return the size of a file, reported by os.stat().(R3R4tst_size(tfilename((s macpath.pycR tscCsti|ƒiS(sCReturn the last modification time of a file, reported by os.stat().(R3R4tst_mtime(R:((s macpath.pycR xscCsti|ƒiS(s=Return the last access time of a file, reported by os.stat().(R3R4tst_atime(R:((s macpath.pycR |scCs9y'ddk}|ii|dƒdSWn tSnXdS(s6Return true if the pathname refers to a symbolic link.iÿÿÿÿNii(t Carbon.FiletFiletResolveAliasFileR0(R&tCarbon((s macpath.pycRs  cCs=yti|ƒ}Wntij o tSnXt|iƒS(s?Return true if the pathname refers to an existing regular file.(R3R4R5R0tS_ISREGR7(R&R8((s macpath.pycR‹s  cCsti|ƒiS(s:Return the creation time of a file, reported by os.stat().(R3R4tst_ctime(R:((s macpath.pycR ”scCs4yti|ƒ}Wntij o tSnXtS(sDTest whether a path exists. Returns False for broken symbolic links(R3R4R5R0tTrue(R&R8((s macpath.pycR˜s  cCs4yti|ƒ}Wntij o tSnXtS(sCTest whether a path exists. Returns True for broken symbolic links(R3tlstatR5R0RC(R%R8((s macpath.pycR¤s  cCs‚|pdSnt|ƒ}t|ƒ}tt|ƒt|ƒƒ}x5t|ƒD]'}||||jo || SqOqOW|| S(sGGiven a list of pathnames, returns the longest common leading componentR)(tmintmaxR+txrange(tmts1ts2tnR-((s macpath.pycR ¯s   cCs|S(sEDummy to retain interface-compatibility with other operating systems.((R%((s macpath.pycR»scCs|S(sEDummy to retain interface-compatibility with other operating systems.((R%((s macpath.pycRÀst norm_errorcBseZdZRS(sPath cannot be normalized(t__name__t __module__t__doc__(((s macpath.pycRLÄscCsd|jo d|Sn|idƒ}d}x†|t|ƒdjon||djoO||ddjo:|djo ||d|d5|d}q²td‚q1|d}q1Wdi|ƒ}|ddjo8t|ƒdjo%|dt|ƒjo|d }n|S(sLNormalize a pathname. Will return the same result for equivalent paths.R"iR)s+Cannot use :: immediately after volume nameiÿÿÿÿi(RR+RLR(R&tcompsR-((s macpath.pycRÇs   &  ;cCs“yti|ƒ}Wntij o dSnX||||ƒxL|D]D}t||ƒ}t|ƒo"t|ƒ ot|||ƒqGqGWdS(sIDirectory tree walk with callback function. For each directory in the directory tree rooted at top (including top itself, but excluding '.' and '..'), call func(arg, dirname, fnames). dirname is the name of the directory, and fnames a list of the names of the files and subdirectories in dirname (excluding '.' and '..'). func may modify the fnames list in-place (e.g. via del or slice assignment), and walk will only recurse into the subdirectories whose names remain in fnames; this can be used to implement a filter, or to impose a specific order of visiting. No semantics are defined for, or required of, arg, beyond that arg is always passed to func. It can be used, e.g., to pass a filename pattern, or a mutable object designed to accumulate statistics. Passing None for arg is common.N(R3tlistdirR5RRRR(ttoptfunctargtnamestname((s macpath.pycRãs cCs0t|ƒpttiƒ|ƒ}nt|ƒS(sReturn an absolute path.(RRR3tgetcwdR(R%((s macpath.pycRýs c Cs©t|ƒ}yddk}Wntj o |SnX|p|Sn|idƒ}|dd}x@|dD]4}t||ƒ}|ii|dƒdiƒ}qmW|S(NiÿÿÿÿR"ii(RR=t ImportErrorRRR>tFSResolveAliasFilet as_pathname(R%R@R1tc((s macpath.pycR s   #(*ROR3R4t__all__RRRRRRtNoneRRRRRRRRRRR2RR R R RRR RRR RRt ExceptionRLRRRR R0R!(((s macpath.pycssV