• File: posixpath.cpython-38.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/proc/self/root/opt/alt/python38/lib64/python3.8/__pycache__/posixpath.cpython-38.pyc
  • Date Modified: 10/26/2026 8:15 PM
  • File size: 10.47 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
U

j>'@sjdZdZdZdZdZdZdZdZdZddl	Z	ddl
Z
ddlZddlZdd	lTd
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0g'Z
d1d2Zd3d
Zd4dZd5dZd6dZd7dZejje_d8d
Zd9dZd:dZd;dZd<dZd=dZd>dZd?Zdadad@dZdAdZ dBd Z!dCdDdEd,Z"dFdGZ#e
j$dHkZ%dKdId.Z&dJd/Z'dS)LaCommon 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
splitdrivesplitsplitextbasenamedirnamecommonprefixgetsizegetmtimegetatimegetctimeislinkexistslexistsisdirisfileismount
expanduser
expandvarsnormpathabspathsamefilesameopenfilesamestatcurdirpardirseppathsepdefpathaltsepextsepdevnullrealpathsupports_unicode_filenamesrelpath
commonpath
ALLOW_MISSINGcCst|trdSdSdS)N/r)
isinstancebytespathr3./opt/alt/python38/lib64/python3.8/posixpath.py_get_sep)s
r5cCs
t|S)z6Normalize case of pathname.  Has no effect under Posixosfspath)sr3r3r4r4scCst|}t|}||S)zTest whether a path is absolute)r7r8r5
startswith)r9r#r3r3r4r<s
c
Gst|}t|}|}z^|s,|dd|ttj|D]8}||rL|}q8|rZ||rd||7}q8|||7}q8Wn.tttfk
rt	j
d|f|YnX|S)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	)r7r8r5mapr:endswith	TypeErrorAttributeErrorBytesWarninggenericpath_check_arg_types)apr#r2br3r3r4r	Gs 


cCs`t|}t|}||d}|d|||d}}|rX||t|krX||}||fS)zSplit a pathname.  Returns tuple "(head, tail)" where "tail" is
    everything after the final slash.  Either part may be empty.Nr7r8r5rfindlenrstrip)rCr#iheadtailr3r3r4rds

cCs6t|}t|trd}d}nd}d}t||d|S)Nr..rr)r7r8r/r0r@	_splitext)rCr#r'r3r3r4rus

cCst|}|dd|fS)zJSplit a pathname into drive and path. On Posix, drive is always
    empty.Nrr6)rCr3r3r4r
s
cCs,t|}t|}||d}||dS)z)Returns the final component of a pathnamerEN)r7r8r5rG)rCr#rJr3r3r4r
s
cCsNt|}t|}||d}|d|}|rJ||t|krJ||}|S)z-Returns the directory component of a pathnamerENrF)rCr#rJrKr3r3r4rs

c
Cs8zt|}Wntttfk
r*YdSXt|jS)z&Test whether a path is a symbolic linkF)r7lstatOSError
ValueErrorr>statS_ISLNKst_mode)r2str3r3r4rs
c	Cs.zt|Wnttfk
r(YdSXdS)zCTest whether a path exists.  Returns True for broken symbolic linksFT)r7rOrPrQr1r3r3r4rs
c	Cszt|}Wnttfk
r(YdSXt|jr:dSt|trPt	|d}n
t	|d}t
|}zt|}Wnttfk
rYdSX|j}|j}||krdS|j}|j}||krdSdS)z$Test whether a path is a mount pointF..rT)
r7rOrPrQrRrSrTr/r0r	r)st_devst_ino)r2s1parents2dev1dev2ino1ino2r3r3r4rs.

c	Cs<t|}t|trd}nd}||s,|St|}||d}|dkrPt|}|dkrdtjkrddl	}z|
tj}Wqt
k
r|YSXn
tjd}nVddl	}|d|}t|trt|d}z||}Wnt
k
r|YSX|j}t|trt|}d}nd	}||}|||dp:|S)
zOExpand ~ and ~user constructions.  If user or $HOME is unknown,
    do nothing.~~rErHOMENASCIIr.r)r7r8r/r0r:r5findrHenvironpwdgetpwuidgetuidpw_dirKeyErrorstrgetpwnamfsencoderI)	r2tilder#rJrfuserhomenamepwentrootr3r3r4rsB








z\$(\w+|\{[^}]*\}?)cst|}t|trZd|kr |Sts@ddl}|t|j	j
at}ddttddn:d|krf|Stsddl}|t|j	j
at}dd	tj
fd
d}|||S)zZExpand shell variables of form $var and ${var}.  Unknown variables
    are left unchanged.$rN{}environb${}cs|d}|r0|s$|dS|dd}z,dkrRttjt|}n|}Wntk
rx|dYSX|SdS)NrEr)r:r<r7rmrefsdecoderj)mrpvalueendrestartr3r4repl4s

zexpandvars.<locals>.repl)r7r8r/r0_varsubbrecompile_varpatternencodercsubgetattr_varsubre)r2rrrr3r~r4rs,

c	Cst|}t|tr&d}d}d}d}nd}d}d}d}||krB|S||}|rp||d	rp||d
spd	}||}g}|D]J}|||fkrq||ks|s|r|r|d|kr||q|r|q|}||}|r|||}|p|S)z0Normalize path, eliminating double slashes, etc.r.rMrVrrrrz)	r7r8r/r0r:rappendpopr	)	r2r#emptydotdotdotinitial_slashescomps	new_compscompr3r3r4rKsJ






cCs@t|}t|s8t|tr&t}nt}t||}t|S)zReturn an absolute path.)	r7r8rr/r0getcwdbgetcwdr	r)r2cwdr3r3r4rqs



F)strictcCs,t|}t|dd||i\}}t|S)zlReturn the canonical path of the specified filename, eliminating any
symbolic links encountered in the path.Nr)r7r8
_joinrealpathr)filenamerr2okr3r3r4r)s
cCs|t|trd}d}d}nd}d}d}|tkr2t}n|r<d}nt}t|rX|dd}|}|rt||\}}	}|rX||kr|qX||kr|rt|\}}||krt|||}qX|}qXt||}
zt	
|
}Wn|k
rd	}YnXt|j
}|s|
}qX|
|kr6||
}|dk	rqX|r(t	|
nt|
|d	fSd||
<t|t	|
||\}}
|
sjt||d	fS|||
<qX|d
fS)Nr.rMrVrrrr3rEFT)r/r0r-FileNotFoundErrorrPr	partitionrr	r7rOrRrSrTrreadlink)r2restrseenr#r!r"
ignored_errorrp_newpathrUis_linkrr3r3r4rs`





rdarwinc	Cs|stdt|}t|tr.d}d}d}nd}d}d}|dkrH|}n
t|}zrd	d
t||D}dd
t||D}tt||g}|gt||||d}|s|WSt	|WSt
ttt
fk
rtd||YnXdS)
z#Return a relative version of a pathzno path specifiedrMr.rVrrrNcSsg|]}|r|qSr3r3.0xr3r3r4
<listcomp>szrelpath.<locals>.<listcomp>cSsg|]}|r|qSr3r3rr3r3r4rsr+)rQr7r8r/r0rrrHrr	r=r>r?DeprecationWarningr@rA)	r2rr!r#r"
start_list	path_listrJrel_listr3r3r4r+s0



c		s2|stdtttj|}t|dtr4ddnddzƇfdd|D}ztfd	d
|D\}Wntk
rtddYnXfd
d|D}t|}t	|}|}t
|D]$\}}|||kr|d|}qq|rn
dd}||WStt
fk
r,tjd|YnXdS)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencerr.rMrrcsg|]}|qSr3)r)rr2r#r3r4rszcommonpath.<locals>.<listcomp>c3s|]}|ddkVqdS)NrEr3)rrCrr3r4	<genexpr>	szcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNcsg|]}fdd|DqS)csg|]}|r|kr|qSr3r3)rcr!r3r4r
sz)commonpath.<locals>.<listcomp>.<listcomp>r3)rr9rr3r4r
sr,)r,)rQtupler;r7r8r/r0setminmax	enumerater	r=r>r@rA)	pathssplit_pathsrrYr[commonrJrprefixr3)r!r#r4r,s6)N)(__doc__r!r"r'r#r$r%r&r(r7sysrRr@__all__r5rrr	rrrNr
r
rrrrrrrrrrrr)rplatformr*r+r,r3r3r3r4<module>s
	
	

*21&	C

)