python (3.12.0)

(root)/
lib/
python3.12/
__pycache__/
posixpath.cpython-312.pyc

ˑeDfdZdZdZdZdZdZdZdZdZddl	Z	ddl
Z
ddlZddlZdd	lgd
Z
dZdZd
ZdZdZdZej(je_dZdZdZdZdZdZdZdZdadadZ	ddl m!Z!dZ"dZ$ddd Z%d!Z&e
jNd"k(Z(d%d#Z)d$Z*y#e#$rdZ"Y-wxYw)&aCommon operations on Posix pathnames.

Instead of importing this module directly, import os and refer to
this module as os.path.  The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Windows),
os.path provides the same operations in a manner specific to that
platform, and is an alias to another module (e.g. ntpath).

Some of this can actually be useful on non-Posix systems too, e.g.
for manipulation of the pathname component of URLs.
.../:z
/bin:/usr/binNz	/dev/null)*)(normcaseisabsjoin
splitdrive	splitrootsplitsplitextbasenamedirnamecommonprefixgetsizegetmtimegetatimegetctimeislinkexistslexistsisdirisfileismount
expanduser
expandvarsnormpathabspathsamefilesameopenfilesamestatcurdirpardirseppathsepdefpathaltsepextsepdevnullrealpathsupports_unicode_filenamesrelpath
commonpath
isjunctionc&t|tryy)N/r)
isinstancebytespaths =/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/posixpath.py_get_sepr7)s$c,tj|S)z6Normalize case of pathname.  Has no effect under Posixosfspath)ss r6rr4s
99Q<r8cdtj|}t|}|j|S)zTest whether a path is absolute)r;r<r7
startswith)r=r%s  r6r	r	<s'
		!A
1+C<<r8cjtj|}t|}|}	|s|dd|zttj|D]7}|j	|r|}|r|j|r||z
}0|||zz
}9	|S#tttf$rtjd|g|wxYw)zJoin two or more pathname components, inserting '/' as needed.
    If any component is an absolute path, all previous path components
    will be discarded.  An empty last part will result in a path that
    ends with a separator.Nrr
)r;r<r7mapr?endswith	TypeErrorAttributeErrorBytesWarninggenericpath_check_arg_types)apr%r5bs     r6r
r
Gs
			!A
1+CD!HsNRYY"	 A||C T]]3/	a
	 K
~|4$$VQ33
sAB-B2ctj|}t|}|j|dz}|d|||d}}|r"||t	|zk7r|j|}||fS)zSplit a pathname.  Returns tuple "(head, tail)" where "tail" is
    everything after the final slash.  Either part may be empty.Nr;r<r7rfindlenrstrip)rIr%iheadtails     r6r
r
dsk			!A
1+C	qA2A!"$DCI
%{{3:r8ctj|}t|trd}d}nd}d}t	j
||d|S)Nr1.rr)r;r<r2r3rF	_splitext)rIr%r)s   r6rrusD
		!A!U  Cv66r8c:tj|}|dd|fS)zJSplit a pathname into drive and path. On Posix, drive is always
    empty.Nrr:)rIs r6rrs 			!ARa5!8Or8ctj|}t|trd}d}nd}d}|dd|k7r|||fS|dd|k7s|dd|k(r|||ddfS||dd|ddfS)	aSplit a pathname into drive, root and tail. On Posix, drive is always
    empty; the root may be empty, a single slash, or two slashes. The tail
    contains anything after the root. For example:

        splitroot('foo/bar') == ('', '', 'foo/bar')
        splitroot('/foo/bar') == ('', '/', 'foo/bar')
        splitroot('//foo/bar') == ('', '//', 'foo/bar')
        splitroot('///foo/bar') == ('', '/', '//foo/bar')
    r1r8rNrL)r;r<r2r3)rIr%emptys   r6rrs			!A!U!u|eQ	
1Q3!Aa&C-c1QR5  aeQqrU""r8cttj|}t|}|j|dz}||dS)z)Returns the final component of a pathnamerLN)r;r<r7rN)rIr%rQs   r6rrs5
		!A
1+C	qAQR5Lr8ctj|}t|}|j|dz}|d|}|r"||t	|zk7r|j|}|S)z-Returns the directory component of a pathnamerLNrM)rIr%rQrRs    r6rrsZ
		!A
1+C	qARa5DCI
%{{3Kr8c.tj|y)zQTest whether a path is a junction
    Junctions are not a part of posix semanticsFr:r4s r6r/r/sIIdOr8cZ	tj|y#ttf$rYywxYw)zCTest whether a path exists.  Returns True for broken symbolic linksFT)r;lstatOSError
ValueErrorr4s r6rrs0

Z s**c	tj|}tj|jrytj|}t|tr
t|d}nt|d}t|}	tj|}|j}|j}||k7ry|j}|j}||k(ryy#t
tf$rYywxYw#t
tf$rYywxYw)z$Test whether a path is a mount pointF..rT)r;rastatS_ISLNKst_moderbrcr<r2r3r
r+st_devst_ino)r5s1parents2dev1dev2ino1ino2s        r6rrs
XXd^<<

#
99T?D$dE"dD!
f
F
XXf
99D
99Dt|
99D
99Dt|7
Z  
Z s#CC(C%$C%(C:9C:c`tj|}t|trd}nd}|j	|s|St|}|j
|d}|dkrt|}|dk(rZdtjvr4	ddl	}	|jtjj}nXtjd}nD	ddl	}|d|}t|trt|d}	|j!|}|j}|t"j$dk(r|St|trtj&|}d	}nd
}|j)|}|||dzxs|S#t$r|cYSwxYw#t$r|cYSwxYw#t$r|cYSwxYw#t$r|cYSwxYw)zOExpand ~ and ~user constructions.  If user or $HOME is unknown,
    do nothing.~~rLrHOMENASCIIvxworksr1r)r;r<r2r3r?r7findrOenvironpwdImportErrorgetpwuidgetuidpw_dirKeyErrorstrgetpwnamsysplatformfsencoderP)	r5tilder%rQrzuserhomenamepwentroots	         r6rrs99T?D$??5!
4.C		#qA1uIAv#

<<		4;;zz&)H	AaydE"tW%D	LL&E
<<CLLI5$;;x(t$HtABx(D(I




	K		K	sHE,-E=F1F,E:9E:=F
FFFF-,F-c,tj|}t|trRd|vr|Sts ddl}|j
d|jatj}d}d}ttdd}nPd|vr|Sts ddl}|j
d	|ja
tj}d
}d}tj}d}	|||}|s	|S|jd\}}|jd}	|	j|r|	j|r|	dd
}		|:tj tjtj"|	}
n||	}
||d}|d||
z}t%|}||z
}#t&$r|}YwxYw)zZExpand shell variables of form $var and ${var}.  Unknown variables
    are left unchanged.$rNs\$(\w+|\{[^}]*\}){}environb$z\$(\w+|\{[^}]*\}){}rL)r;r<r2r3	_varprogbrecompilervsearchgetattr_varprogryspangroupr?rBrfsdecoderOr)r5rrstartendryrQmjrvaluerSs            r6rr@s99T?D$tK

#8"((CI!!"j$/d?Kzz"6AH**	A
4O"K!vvay1wwqz??5!dmmC&8":D	BJJr{{4/@$AB
8D8e#DD	ADLD'	A	s&AFFF)_path_normpathctj|}t|tr5tjttj|xsdSt|xsdS)0Normalize path, eliminating double slashes, etc.rUr)r;r<r2r3rrrr4s r6rrsKyydE";;~bkk$.?@AITId#*s*r8ctj|}t|tr	d}d}d}d}nd}d}d}d}||k(r|St	|\}}}|j|}g}|D]A}	|	||fvr
|	|k7s|s|r
|r|d	|k(r|j
|	/|s2|jC|}||j|z}|xs|S)
rr1r8rUrerrYrrr)	r;r<r2r3rr
appendpopr
)
r5r%r\dotdotdot_initial_slashescomps	new_compscomps
          r6rrysyydE"CECFCECF5=J#,T? ?D

3		 Ds|#y	"
 7  &

	 %0{sr8ctj|}t|sEt|trtj
}ntj}t||}t|S)zReturn an absolute path.)	r;r<r	r2r3getcwdbgetcwdr
r)r5cwds  r6rrsK
99T?D;dE"**,C))+CCD>r8F)strictcjtj|}t|dd||i\}}t|S)zlReturn the canonical path of the specified filename, eliminating any
symbolic links encountered in the path.Nr)r;r<
_joinrealpathr)filenamerr5oks    r6r+r+s6yy"HXbq\8VR@HD"4=r8ct|trd}d}d}nd}d}d}t|r|dd}|}|r|j|\}}}|r||k(r ||k(r&|r!t	|\}}||k(rt|||}n|}Kt||}		t
j|	}
tj|
j}|s|	}|	|vr.||	}||rt
j|	nt|	|dfSd||	<t|t
j|	||\}}|st||dfS|||	<|r|d	fS#t$r|rd}YwxYw)
Nr1rUrerrrrLFT)r2r3r		partitionr
r
r;rarfrgrhrbrreadlink)
r5restrseenr%r#r$rrnewpathstis_linkrs
             r6rrs$T{ABx
s+
atv~6>"4[
d6>ff5DtT"	/'"Bll2::.GDd?=D GT*E11W
 r{{7';VTJbd#U**W
Y\:;	G	sD99E
	E
darwincP|stdtj|}t|trd}d}d}nd}d}d}||}ntj|}	t|j
|Dcgc]}|s|	}}t|j
|Dcgc]}|s|	}}tt||g}|gt||z
z||dz}	|	s|St|	Scc}wcc}w#ttttf$rtjd	||wxYw)
z#Return a relative version of a pathzno path specifiedrUr1rerrrNr-)rcr;r<r2r3rr
rOrr
rCrDrEDeprecationWarningrFrG)
r5rr#r%r$x
start_list	path_listrQrel_lists
          r6r-r-s,,--
99T?D$}		% !(!5!5c!:@Aaa@
@ '
 3 3C 8>1AQ>	>j)4568s:q01IabMAMXA>
~|5GH$$Ye<
s<C37C)?C)C3!C.)C.-3C3!C3)
C332D%c	|stdtttj|}t|dtrdd}ndd}	|Dcgc]}|j}}	tfd|D\}|Dcgc]}|Dcgc]
}|s||k7s|c}}}}t|}t|}|}	t|D]\}
}|||
k7s|d	|
}	n|rnd	d}|j|	zScc}w#t$r
tdd	wxYwcc}wcc}}w#ttf$rtj d
g|wxYw)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencerr1rUrrc3.K|]}|ddk(yw)NrL).0rIr%s  r6	<genexpr>zcommonpath.<locals>.<genexpr>4s5!2A#5sz%Can't mix absolute and relative pathsNr.)rctuplerAr;r<r2r3r
setminmax	enumerater
rCrDrFrG)
pathsr#r5split_pathsr	r=crkrmcommonrQprefixr%s
            @r6r.r."st@AA#bii'(E%(E"3894tzz#99	P5u55FEEPPq1:aa6k:PP



bM	DAqBqEzBQ	
3r7(((#:	PDE4O	P;P
~&$$\:E:
slD,D+D,.DD,		D&D!D! D!$D&)4D,$D,D,DD,!D&&D,,'E)N)+__doc__r#r$r)r%r&r'r(r*r;rrfrF__all__r7rr	r
r
rrVrrrrr/rrrrrrposixrrr{rr+rrr,r-r.rr8r6<module>rs


	
		


	

	
':	"7((00
#>V6)z	.j(+$D+	"'<~"llh6!R#Us9B%%B0/B0