\d2ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z m Z mZmZddlmZddlmZmZmZmZmZmZmZddlmZgdZdZd Zd Z e e eefZ!eee fZ"d Z#d Z$Gd de%Z&Gdde&Z'Gdde&Z(e'Z)e(Z*dZ+e,edrej-e+Z+GddZ.GddZ/Gdde.Z0Gdde.Z1Gdde.Z2Gdd e Z3Gd!d"e%Z4ej56e4Gd#d$e4Z7Gd%d&e4Z8Gd'd(e4Z9Gd)d*e9e7Z:Gd+d,e9e8Z;dS)-N)Sequence)ENOENTENOTDIREBADFELOOP) attrgetter)S_ISDIRS_ISLNKS_ISREGS_ISSOCKS_ISBLKS_ISCHRS_ISFIFO)quote_from_bytes)PurePath PurePosixPathPureWindowsPathPath PosixPath WindowsPath{icbt|ddtvpt|ddtvS)Nerrnowinerror)getattr_IGNORED_ERRNOS_IGNORED_WINERRORS) exceptions 5J:\tools\MySQL Workbench 8.0 CE\python\Lib\pathlib.py _ignore_errorr!&s7 Iw - - @ G Iz4 0 04F FHcd|vpd|vpd|vS)N*?[)pats r _is_wildcard_patternr)+s  #: 1 1scz1r"c$eZdZdZdZdZdZdS)_FlavourzPA flavour implements a particular (platform-specific) set of path semantics.c(|jj|_dSN)sepjoinselfs r __init__z_Flavour.__init__5sHM r"cg}|j}|j}dx}}t|}|D]}|s|r|||}||\}}} || vrUt| |D]1} | r-| dkr'|tj| 2n/| r-| dkr'|tj| |s|rC|s?|D]<}|s|r|||}||d}|rn=n|s|r|||z| |||fS)N.r) r.altsepreversedreplace splitrootsplitappendsysinternreverse) r1partsparsedr.r6drvrootitpartrelxs r parse_partsz_Flavour.parse_parts8shd e__  D  1||FC00!^^D11NCsczz!#))C..1155A5Q#XX cjmm444533#::MM#*S//222 d  "!#""#%$!=#'<<#<#C >EC%K=6!"":#===  -s{{dmmD11T]]35G5GGGD%&*"444H efn, ,UF""r"N)__name__ __module__ __qualname____doc__r2rGrNr'r"r r+r+1sL"""$!$!$!L#####r"r+ceZdZdZdZdZeZej dkZ e dZ dZ hddd Dzd d DzZefd Zd Zd ZdZe fdZdZdZdS)_WindowsFlavour\/Tnt4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz\\?\>CONIN$CONOUT$AUXCONNULPRNch|]}d|zS)zCOM%sr'.0cs r z_WindowsFlavour.6661666r"u123456789¹²³ch|]}d|zS)zLPT%sr'r`s r rcz_WindowsFlavour.rdr"c|dd}|dd}||kr3||kr-||\}}|dd}|dd}nd}|dd}||kr||kr||kr||d}|dkrl|||dz}||dzkrJ|dkrt|}|r||d|z|||dzdfS|d||||dzdfSdx} } |dkr||jvr|dd} |dd}|}||kr|} ||}|| z| |fS)NrrIr4:)_split_extended_pathfindlen drive_letterslstrip) r1rDr.firstsecondprefixthirdindexindex2rArBs r r9z_WindowsFlavour.splitrootsQqS ac cMMesll 44T::LFD1IE!A#YFFFQqS  cMMesllu|| IIc1%%E{{3 22UQY&&||!$TC%QvX6T&())_LL#GVG}c4q ?BBd S==Ud&888rr(C8DE C<<D;;s##D|T4''r"c*|Sr-lowerr1ss r rJz_WindowsFlavour.casefoldswwyyr"cd|DS)Nc6g|]}|Sr'rw)raps r z2_WindowsFlavour.casefold_parts..s )))a )))r"r'r1r?s r casefold_partsz_WindowsFlavour.casefold_partss))5))))r"cntjtj|tjjSr-)recompilefnmatch translate IGNORECASE fullmatchr1patterns r compile_patternz_WindowsFlavour.compile_patterns$z'+G44bmDDNNr"cd}||rC|dd}|dd}|dr||ddz }d|ddz}||fS)Nr4zUNC\rhrU) startswith)r1rz ext_prefixrrs r rkz$_WindowsFlavour._split_extended_pathsu << # # !rrUF!""A||G$$ !!BQB%1QRR5Lqyr"c|sdS|ddrdS|dddddd}||jvS)NFrz\\rir5rj )r partitionrstripupperreserved_names)r1r?names r is_reservedz_WindowsFlavour.is_reserveds  5 8  v & & 5Ry""3''*44S99!<CCCHHzz||t222r"cj|j}t|dkrc|ddkrW|ddd}d|dt |dSdt |dzS)NrgrIrjrVzfile:///zutf-8zfile:)drivermas_posixrourlquote_from_bytesencode)r1pathrrests r make_uriz_WindowsFlavour.make_uris  u::??uQx3==??122&--c22DD*4;;w+?+?@@@B B01G1G1P1PQQQ Qr"N)rOrPrQr.r6has_drvntpathpathmodosr is_supportedsetrnext_namespace_prefixrr9rJrrrkrrr'r"r rTrTps C FGGGtOLCNOOM$ :99665666 7665666 7*#&%(%(%(%(N***OOO2F 3 3 3 R R R R Rr"rTc\eZdZdZdZdZeZej dkZ efdZ dZ dZ dZd Zd Zd S) _PosixFlavourrVr4FrWc|rQ|d|krE||}t|t|z dkrd|dz|fSd||fSdd|fS)Nrrgr4)rorm)r1rDr. stripped_parts r r9z_PosixFlavour.splitrootsq  DGsNN KK,,M 4yy3}---2237M113 --r4< r"c|Sr-r'rys r rJz_PosixFlavour.casefoldsr"c|Sr-r'rs r rz_PosixFlavour.casefold_partss r"cXtjtj|jSr-)rrrrrrs r rz_PosixFlavour.compile_patterns z'+G4455??r"cdS)NFr'rs r rz_PosixFlavour.is_reservedsur"cDt|}dt|zS)Nzfile://)bytesr)r1rbpaths r rz_PosixFlavour.make_uri s#d .u5555r"N)rOrPrQr.r6r posixpathrrrrr9rJrrrrr'r"r rrs C FGGGtOL"%     @@@66666r"rc|d}|dd}|stS|dkrt}n1d|vrtdt|rt}nt }||||S)NrrI**z:Invalid pattern: '**' can only be an entire path component)_TerminatingSelector_RecursiveWildcardSelector ValueErrorr)_WildcardSelector_PreciseSelector) pattern_partsflavourr( child_partsclss r _make_selectorrs  C#K &#%%% d{{( UVVV c " " 3sK ) ))r" lru_cacheceZdZdZdZdZdS) _SelectorzYA selector matches a specific glob pattern part against the children of a given path.c||_|rt|||_d|_dSt |_d|_dS)NTF)rr successordironlyr)r1rrs r r2z_Selector.__init__0sF&  !+KAADNDLLL133DN DLLLr"ct|}|j}|j}|j}||st gS|||||S)zuIterate over all child paths of `parent_path` matched by this selector. This can contain parent_path itself.)typeis_direxists_scandiriter _select_from)r1 parent_pathpath_clsrrscandirs r select_fromz_Selector.select_from9s^ $$#vk"" 88O  ffgFFFr"N)rOrPrQrRr2rr'r"r rr,sA!!! G G G G Gr"rceZdZdZdS)rc#K|VdSr-r')r1rrrrs r rz!_TerminatingSelector._select_fromGsr"N)rOrPrQrr'r"r rrEs#r"rceZdZdZdZdS)rcL||_t|||dSr-)rrr2)r1rrrs r r2z_PreciseSelector.__init__Ms' 4g66666r"c#K ||j}|jr|n||r$|j||||D]}|VdSdS#t $rYdSwxYwr-)_make_child_relpathrrrrPermissionError)r1rrrrrr}s r rz_PreciseSelector._select_fromQs 2249==D2$,2FD99 44T667SSAGGGG      FF sAA A('A(NrOrPrQr2rr'r"r rrKs2777r"rceZdZdZdZdS)rcr|||_t|||dSr-)rmatchrr2r1r(rrs r r2z_WildcardSelector.__init__]s5,,S11 4g66666r"c#K ||5}t|}dddn #1swxYwY|D]}|jr> |sn'#t$r}t |sYd}~?d}~wwxYw|j} || r9|| } |j | |||D]} | VdS#t$rYdSwxYwr-) listrrOSErrorr!rrrrrr) r1rrrr scandir_itentriesentryerrr}s r rz_WildcardSelector._select_fromas~ %% +z** + + + + + + + + + + + + + + +   < ! ! %||~~%$%"!!!,Q//"! !z::d## &::4@@D!^88vvwWW  !  "    FF sW C+ C/C/CAC A<"A72C7A<t|||dSr-)rr2rs r r2z#_RecursiveWildcardSelector.__init__|s 4g66666r"c#K|V ||5}t|}dddn #1swxYwY|D]}}d} |d}n'#t$r}t|sYd}~nd}~wwxYw|r8||j} || ||D]} | V~dS#t$rYdSwxYw)NFfollow_symlinks)rrrr!rr_iterate_directoriesr) r1rrrrrr entry_is_dirrrr}s r rz/_RecursiveWildcardSelector._iterate_directoriessy %% +z** + + + + + + + + + + + + + + + $ #(<<<#F#FLL(++  &::5:FFD!66tVWMM       FF sV B</ B<3B<3 B<AB< A<"A72B<7A<<>B<< C  C c#PK t} |jj}||||D]0}|||||D]}||vr|V|| 1 |dS#|wxYw#t $rYdSwxYwr-)rrrraddclearr) r1rrrryieldedsuccessor_selectstarting_pointr}s r rz'_RecursiveWildcardSelector._select_froms eeG #'>#> &*&?&? VU\&]&]++N--nffgVV++G++"#GGG#KKNNN++       FF s)BAA>(B>BB B%$B%N)rOrPrQr2rrr'r"r rrzsA777&     r"rc.eZdZdZdZdZdZdZdZdS) _PathParentszvThis object provides sequence-like access to the logical ancestors of a path. Don't try to construct it yourself.)_pathcls_drv_root_partscvt||_|j|_|j|_|j|_dSr-)rrrrr)r1rs r r2z_PathParents.__init__s.T  I Z k r"ct|js|jrt|jdz St|jSNrI)rrrmrr0s r __len__z_PathParents.__len__s: 9 $  $t{##a' 't{## #r"c t|trBtfdt|t DS|t ks|t  krt ||dkr|t z }jj j j d| dz S)Nc3(K|] }|V dSr-r')rair1s r z+_PathParents.__getitem__..s'IIQaIIIIIIr"rrI) isinstanceslicetuplerangeindicesrm IndexErrorr_from_parsed_partsrrr)r1idxs` r __getitem__z_PathParents.__getitem__s c5 ! ! JIIII%SYY1G1G*HIIIII I #d))  sc$iiZ//S// ! 77 3t99 C}// 4:04 IcTAXI0FHH Hr"c@d|jjS)Nz <{}.parents>)formatrrOr0s r __repr__z_PathParents.__repr__s$$T]%;<<A  A c t|Sr-)rr0s r __fspath__zPurePath.__fspath__"s4yyr"c`|j}t||jdS)zNReturn the string representation of the path with forward (/) slashes.rV)rrr8r.r1fs r rzPurePath.as_posix%s) M4yy  ,,,r"c*tj|S)zaReturn the bytes representation of the path. This is only recommended to use under Unix.)rfsencoder0s r __bytes__zPurePath.__bytes__+s{4   r"cfd|jj|S)Nz{}({!r}))rrrOrr0s r rzPurePath.__repr__0s%  !8$--//JJJr"c||std|j|S)z Return the path as a 'file' URI.z.relative path can't be expressed as a file URI) is_absoluterrrr0s r as_urizPurePath.as_uri3s<!! OMNN N}%%d+++r"c |jS#t$r.|j|j|_|jcYSwxYwr-)rr%rrrr0s r _cpartszPurePath._cparts9sT '& & ' ' '"&-">">t{"K"KD & & & & 's 5AAcvt|tstS|j|jko |j|juSr-)rrNotImplementedr4rr1others r __eq__zPurePath.__eq__Bs7%** "! !|u},P%.1PPr"c |jS#t$r0tt|j|_|jcYSwxYwr-)r r%hashrr4r0s r __hash__zPurePath.__hash__GsQ :    eDL1122DJ:    s 7AAcvt|tr|j|jurtS|j|jkSr-rrrr6r4r7s r __lt__zPurePath.__lt__N7%** "dm5>.Q.Q! !|em++r"cvt|tr|j|jurtS|j|jkSr-r>r7s r __le__zPurePath.__le__S7%** "dm5>.Q.Q! !|u},,r"cvt|tr|j|jurtS|j|jkSr-r>r7s r __gt__zPurePath.__gt__Xr@r"cvt|tr|j|jurtS|j|jkSr-r>r7s r __ge__zPurePath.__ge__]rCr"rz.The drive prefix (letter or UNC path), if any.)docrzThe root of the path, if any.c$|j|jz}|S)z/The concatenation of the drive and root, or ''.)rr)r1anchors r rJzPurePath.anchorhsTZ' r"cj|j}t||js|jrdndkrdS|dS)z!The final path component, if any.rIrr4ri)rrmrrrs r rz PurePath.namens=  u:: ?TZ?!!a @ @2Ryr"c|j}|d}d|cxkrt|dz kr nn ||dSdS)z{ The final component's last suffix, if any. This includes the leading period. For example: '.txt' r5rrINr4rrfindrmr1rrs r suffixzPurePath.suffixvsXy JJsOO q 3t99q= 8O2r"c|j}|drgS|d}d|dddDS)z A list of the final component's suffixes, if any. These include the leading periods. For example: ['.tar', '.gz'] r5cg|]}d|zS)r5r')rarPs r r~z%PurePath.suffixes..s???f ???r"rIN)rendswithror:r1rs r suffixeszPurePath.suffixess\y ==   I{{3??4::c??122+>????r"c|j}|d}d|cxkrt|dz kr nn |d|S|S)z0The final path component, minus its last suffix.r5rrINrMrOs r stemz PurePath.stemsXy JJsOO q 3t99q= 8OKr"cl|jst|d|j|f\}}}|r7|d|jj|jjfvs|s|st |dkrtd|z||j|j |j dd|gzS)z-Return a new path with the file name changed. has an empty namerirIzInvalid name %rN) rrrrGr.r6rmrrrr)r1rrArBr?s r with_namezPurePath.with_namesy ?ttt=>> >=44dW==T5 9RT]%6 8L$MMMNN!%jjAoo.$788 8&&ty$*'+{3B3'74&'@BB Br"c<|||jzS)z(Return a new path with the stem changed.)rZrP)r1rWs r with_stemzPurePath.with_stems~~dT[0111r"c|j}|j|vs|jr|j|vrtd||r|dr|dkrtd|z|j}|st|d|j}|s||z}n|dt| |z}||j |j |j dd|gzS)zReturn a new path with the file suffix changed. If the path has no suffix, add given suffix. If the given suffix is an empty string, remove the suffix from the path. zInvalid suffix r5zInvalid suffix %rrYNri) rr.r6rrrrPrmrrrr)r1rPr+r old_suffixs r with_suffixzPurePath.with_suffixs  M 5F??ah?18v+=+=*FF<== =  =&++C00 =FcMM0F;<< <y ?ttt=>> >[  4&=DD)#j//))*V3D&&ty$*'+{3B3'74&'@BB Br"cR|std|j}|j}|j}|r||g|ddz}n|}||\}}}|r||g|ddz} n|} t | } |jj} | dkr|s|run | |d| | | krT||||} td t|t| | d| dkr|nd|| dS)zReturn the relative path to another path identified by the passed arguments. If the operation is not possible (because this is not a subpath of the other path), raise ValueError. zneed at least one argumentrINrzU{!r} is not in the subpath of {!r} OR one path is relative and the other is absolute.r4) rrrrrrmrrr!rrrr) r1r8r?rArB abs_partsto_drvto_rootto_parts to_abs_partsncf formatteds r relative_tozPurePath.relative_tosf :899 9 iz  d eABBi/III$($4$4U$;$;!  $"G,x|;LL#L    ] )FFDFCF9RaR=(9(9RR =M=M(M(M11&'8LLIJ$fSYYI??AA A&&r16644r'0}66 6r"c> |j|dS#t$rYdSwxYw)zFReturn True if the path is relative to another path or False. TF)rirr7s r is_relative_tozPurePath.is_relative_tos>  D e $ $4   55 s  cr |jS#t$r#t|j|_|jcYSwxYw)zZAn object providing sequence-like access to the components in the filesystem path.)r r%rrr0s r r?zPurePath.partssI  <     --DL<    s  *66c,||S)zCombine this path with one or several arguments, and return a new path representing either a subpath (if all arguments are relative paths) or a totally different path (if one of the arguments is anchored). )r#)r1rs r joinpathzPurePath.joinpaths %%%r"c^ ||fS#t$r tcYSwxYwr-)r#rr6r1keys r __truediv__zPurePath.__truediv__sD "##SF++ + " " "! ! ! ! "s ,,cn ||g|jzS#t$r tcYSwxYwr-)rrrr6rps r __rtruediv__zPurePath.__rtruediv__sK "##SEDK$788 8 " " "! ! ! ! "s  44c|j}|j}|j}t|dkr|s|r|S||||ddS)zThe logical parent of the path.rINri)rrrrmr)r1rArBr?s r parentzPurePath.parent sUiz  u::???t?K&&sD%*===r"c t|S)z*A sequence of this path's logical parents.)rr0s r parentszPurePath.parentssD!!!r"cV|jsdS|jj pt|jS)zSTrue if the path is absolute (has both a root and, if applicable, a drive).F)rrrboolrr0s r r1zPurePath.is_absolutes.z 5=((;DOO;r"c@|j|jS)zaReturn True if the path contains one of the special names reserved by the system, if any.)rrrr0s r rzPurePath.is_reserveds}((555r"c8|jj}||}|j|f\}}}|std|r|||jkrdS|r|||jkrdS|j}|s|r-t|t|krdS|dd}n"t|t|krdStt|t|D]\}}tj ||sdSdS)zE Return True if this path matches the given pattern. z empty patternFrINT) rrJrGrrrr4rmzipr7r fnmatchcase) r1 path_patternrgrArB pat_partsr?rDr(s r rzPurePath.match$sA] #r,'' #}88,IIT9 ._-- -  3""TY--''5  DBBtzNN**5   $ 9~~U++u!!"" II ^^c%jj ( (5Xe__hy.A.ABB  ID#&tS11 uu tr"N)1rOrPrQrRr rr classmethodrrrr!r#r&r(rr.rr2propertyr4r9r<r?rBrErGrrrBrJrrPrUrWrZr\r_rirkr?rnrrrtrvrxr1rrr'r"r rrskI %%%444 //[/&[[,,[, 999 --- !!! KKK,,, ''X'QQQ ,,, --- ,,, --- HZZ''M O O OE 8JJw''; = = =DX X  X  @ @X @X B B B222BBB*666B   X  &&&""" """ >>X>""X"<<<666 r"rceZdZdZeZdZdS)rzPurePath subclass for non-Windows systems. On a POSIX system, instantiating a PurePath should return this object. However, you can also instantiate it directly on any system. r'N)rOrPrQrR_posix_flavourrr r'r"r rrBs$ HIIIr"rceZdZdZeZdZdS)rzPurePath subclass for Windows systems. On a Windows system, instantiating a PurePath should return this object. However, you can also instantiate it directly on any system. r'N)rOrPrQrR_windows_flavourrr r'r"r rrLs$  HIIIr"rc^eZdZdZdZdZdZdZdZe dZ e dZ d Z d Z d Zd Zd ZdZd7dZdddZdZdZ d8dZdZd9dZdZd:dZdZd;d Zdtjdtd|S)Nz}pathlib.Path.__enter__() is deprecated and scheduled for removal in Python 3.13; Path objects as a context manager is a no-oprg stacklevel)warningswarnDeprecationWarningr0s r __enter__zPath.__enter__ss0  +)Q 8 8 8 8 r"cdSr-r')r1tvtbs r __exit__z Path.__exit__s r"c:|tjS)zjReturn a new path pointing to the current working directory (as returned by os.getcwd()). )rgetcwdrs r cwdzPath.cwds s29;;r"c<|dS)zrReturn a new path pointing to the user's home directory (as returned by os.path.expanduser('~')). ~) expanduserrs r homez Path.homes s3xx""$$$r"c|} |}n7#t$r*||}YnwxYwtj||S)zoReturn whether other_path is the same or not as this file (as returned by os.path.samefile()). )statr%rrrsamestat)r1 other_pathstother_sts r samefilez Path.samefiles{YY[[ 9!((HH 9 9 9~~j116688HHH 9wH---s+1AAc#fKtj|D]}||VdS)zyIterate over the files in this directory. Does not yield any result for the special paths '.' and '..'. N)rlistdirrrTs r iterdirz Path.iterdirsHJt$$ 1 1D**400 0 0 0 0 1 1r"c*tj|Sr-)rrr0s r rz Path._scandirsz$r"c#Ktjd|||s"td||j|f\}}}|s|rt d|d|jj|jjfvr| dtt||j}| |D]}|VdS)zIterate over this subtree and yield all existing files (of any kind, including directories) matching the given relative pattern. zpathlib.Path.globzUnacceptable pattern: {!r}%Non-relative patterns are unsupportedrir4N) r<auditrrrrGrr.r6r;rrrr1rrArBrselectorr}s r globz Path.globs %tW555 K9@@IIJJ J#'=#<#.check_eloopsJq*a00Hw%8/N#N#N"#9AJ#FGGG$O#Nr")strictN)rrrealpathrrr)r1rrrzrr}s r resolvez Path.resolves  H H H    f 55AA    KNNN     aT " "      A s*!' A =AA33 B= B  BTrc.tj||S)zh Return the result of the stat() system call on this path, like os.stat() does. r)rr)r1rs r rz Path.stats wt_====r"c ddl}||jjS#t $rt dwxYw)z: Return the login name of the file owner. rNz*Path.owner() is unsupported on this system)pwdgetpwuidrst_uidpw_name ImportErrorr)r1rs r ownerz Path.owners_ T JJJ<< 233; ; T T T%&RSS S T 47Ac ddl}||jjS#t $rt dwxYw)z8 Return the group name of the file gid. rNz*Path.group() is unsupported on this system)grpgetgrgidrst_gidgr_namerr)r1rs r groupz Path.groups_  T JJJ<< 233; ; T T T%&RSS S TrrriNcdd|vrtj|}tj||||||S)z| Open the file pointed by this path and return a file object, as the built-in open() function does. b)io text_encodingopen)r1mode bufferingencodingerrorsnewlines r rz Path.open s7 d??'11HwtT9hHHHr"c|d5}|cdddS#1swxYwYdS)zK Open the file in bytes mode, read it, and close the file. rbrN)rreadr*s r read_byteszPath.read_bytessYYDY ! ! Q6688                  s 8<<ctj|}|d||5}|cdddS#1swxYwYdS)zJ Open the file in text mode, read it, and close the file. r)rrrN)rrrr)r1rrr+s r read_textzPath.read_texts#H-- YYC(6Y B B a6688                  sAAAct|}|d5}||cdddS#1swxYwYdS)zO Open the file in bytes mode, write to it, and close the file. wbrN) memoryviewrwrite)r1dataviewr+s r write_byteszPath.write_bytes%s $ YYDY ! ! !Q774== ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !sAA A ct|tstd|jjzt j|}|d|||5}||cdddS#1swxYwYdS)zN Open the file in text mode, write to it, and close the file. zdata must be str, not %sw)rrrrN) rrrrrOrrrr)r1rrrrr+s r write_textzPath.write_text.s$$$ 56 N3455 5#H-- YYC(67Y S S !WX774== ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !sBBBcttdstd|tj|fS)zD Return the path to which the symbolic link points. readlinkz*os.readlink() not available on this system)hasattrrrrrr0s r rz Path.readlink9sGr:&& T%&RSS ST!2!2 4555r"c|r( tj|ddS#t$rYnwxYwtjtjz}|s|tjz}tj|||}tj|dS)zS Create this file with the given access mode, if it doesn't exist. N)rutimerO_CREATO_WRONLYO_EXCLrclose)r1rexist_okflagsfds r touchz Path.touchAs   t$$$        R[(  RY E WT5$ ' '  s  ((c tj||dS#t$rF|r |j|kr|jdd||d|YdSt$r|r|sYdSwxYw)z< Create a new directory at this given path. T)rxrFN)rmkdirFileNotFoundErrorrvrr)r1rrxrs r rz Path.mkdirWs  HT4   ? ? ? dkT11 K  dT  : : : JJtUXJ > > > > > >    4;;==     sA B ( B  B c4tj|||dS)zF Change the permissions of the path, like os.chmod(). rN)rchmod)r1rrs r rz Path.chmodhs! t_======r"c4||ddS)z Like chmod(), except if the path points to a symlink, the symlink's permissions are changed, rather than its target's. FrN)r)r1rs r lchmodz Path.lchmodns 4 /////r"cX tj|dS#t$r|sYdSwxYw)zd Remove this file or link. If the path is a directory, use rmdir() instead. N)runlinkr)r1 missing_oks r rz Path.unlinkusM   IdOOOOO         s  ))c.tj|dS)zF Remove this directory. The directory must be empty. N)rrmdirr0s r rz Path.rmdirs r"c.|dS)z Like stat(), except if the path points to a symlink, the symlink's status information is returned, rather than its target's. Fr)rr0s r lstatz Path.lstats yyy///r"cVtj||||S)a2 Rename this path to the target path. The target path may be absolute or relative. Relative paths are interpreted relative to the current working directory, *not* the directory of the Path object. Returns the new Path instance pointing to the target path. )rrenamerr1targets r rz Path.renames( $~~f%%%r"cVtj||||S)aS Rename this path to the target path, overwriting if that path exists. The target path may be absolute or relative. Relative paths are interpreted relative to the current working directory, *not* the directory of the Path object. Returns the new Path instance pointing to the target path. )rr8rrs r r8z Path.replaces( 4   ~~f%%%r"czttdstdtj|||dS)z Make this path a symlink pointing to the target path. Note the order of arguments (link, target) is the reverse of os.symlink. symlinkz)os.symlink() not available on this systemN)rrrr )r1r target_is_directorys r symlink_tozPath.symlink_tosA r9%% S%&QRR R 64!455555r"cxttdstdtj||dS)z Make this path a hard link pointing to the same file as *target*. Note the order of arguments (self, target) is the reverse of os.link's. linkz&os.link() not available on this systemN)rrrrrs r hardlink_tozPath.hardlink_tos> r6"" P%&NOO O r"ctjdtd|||dS)a Make the target path a hard link pointing to this path. Note this function does not make this path a hard link to *target*, despite the implication of the function and argument names. The order of arguments (target, link) is the reverse of Path.symlink_to, but matches that of os.link. Deprecated since Python 3.10 and scheduled for removal in Python 3.12. Use `hardlink_to()` instead. zypathlib.Path.link_to() is deprecated and is scheduled for removal in Python 3.12. Use pathlib.Path.hardlink_to() instead.rgrN)rrrrrrs r link_toz Path.link_tosR  @)Q 8 8 8 8 v**400000r"c |n4#t$r}t|sYd}~dSd}~wt$rYdSwxYwdS)z+ Whether this path exists. NFT)rrr!rr1rs r rz Path.existssu  IIKKKK    ## 55555   55 ts A7 AAc t|jS#t$r}t |sYd}~dSd}~wt $rYdSwxYw)z3 Whether this path is a directory. NF)r rst_moderr!rrs r rz Path.is_dirz 499;;.// /    ## 55555   55 %( AA AAc t|jS#t$r}t |sYd}~dSd}~wt $rYdSwxYw)zq Whether this path is a regular file (also True for symlinks pointing to regular files). NF)r rrrr!rrs r is_filez Path.is_filesz 499;;.// /    ## 55555   55 rct|r|sdS |jj}n#t $rYdSwxYw|j}||krdS|j}|jj}||kS)z; Check if this path is a POSIX mount point FT)rrrvrst_devrst_ino)r1 parent_devdevino parent_inos r is_mountz Path.is_mounts {{}} DKKMM 5 ))++2JJ   55 iikk  *  4iikk [%%''. j  sA AAc t|jS#t$r}t |sYd}~dSd}~wt $rYdSwxYw)z7 Whether this path is a symbolic link. NF)r rrrr!rrs r is_symlinkzPath.is_symlinksx 4::<</00 0    ## 55555   55 rc t|jS#t$r}t |sYd}~dSd}~wt $rYdSwxYw)z6 Whether this path is a block device. NF)r rrrr!rrs r is_block_devicezPath.is_block_device!rrc t|jS#t$r}t |sYd}~dSd}~wt $rYdSwxYw)z: Whether this path is a character device. NF)rrrrr!rrs r is_char_devicezPath.is_char_device1rrc t|jS#t$r}t |sYd}~dSd}~wt $rYdSwxYw)z. Whether this path is a FIFO. NF)rrrrr!rrs r is_fifoz Path.is_fifoAz DIIKK/00 0    ## 55555   55 rc t|jS#t$r}t |sYd}~dSd}~wt $rYdSwxYw)z0 Whether this path is a socket. NF)r rrrr!rrs r is_socketzPath.is_socketQr,rc<|js|js|jr|jddddkrmtj|jd}|dddkrt d||g|jddzS|S)zl Return a new path with expanded ~ and ~user constructs (as returned by os.path.expanduser) rNrIrz#Could not determine home directory.)rrrrrrrr)r1homedirs r rzPath.expanduseras Adj A K A KN2A2.#55g((Q88Grr{c!!"#HIII##WI ABB$?@@ @ r")F)rriNNN)NN)NNN)rT)rFF)2rOrPrQrRr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr8rrrrrrr#r%r'r)r+r.rr'r"r rrYs,IEEE        [ %%[% . . .111      <<<6'+>>>>>TTT T T T59"&IIII!!! ! ! ! !666,".2>>>>> 000     000 & & & & & &6666111(    "!!!(           r"rceZdZdZdZdS)rzsPath subclass for non-Windows systems. On a POSIX system, instantiating a Path should return this object. r'N)rOrPrQrRr r'r"r rrosIIIr"rceZdZdZdZdZdS)rzqPath subclass for Windows systems. On a Windows system, instantiating a Path should return this object. r'c td)Nz-Path.is_mount() is unsupported on this system)rr0s r r#zWindowsPath.is_mount}s!"QRRRr"N)rOrPrQrRr r#r'r"r rrvs9ISSSSSr"r)r=s  %%%%%%////////////PPPPPPPPPPPPPPPPPP@@@@@@   "&7E51#% HHH 222 <#<#<#<#<#v<#<#<#~tRtRtRtRtRhtRtRtRn'6'6'6'6'6H'6'6'6T#?$$ * * * 79k"";*(Y(**>::NGGGGGGGG2     y     >%%%%%%%%X=====8===Btttttvtttp  XHhSSSSS8SSSlmSSSSS$SSSSSr"