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

jf'@sNdZdZdZdZdZdZdZdZdZdd	l	Z	dd	l
Z
dd	lZdd	lZdd
lTddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1g'Z
d2d3Zd4dZd5dZd6d
Zd7dZd8dZd9dZejje_d:dZd;dZd<dZd=dZzdd>lmZWnek
r*d	ZYnXd?dZd@dZdAZd	a d	a!dBdZ"dCd Z#dDdEZ$zddFlm%Z%Wnek
re$Z&Yn
XdGd!Z&zddHlm'Z'm(Z)Wn$ek
rdIdJdKd*Z*Yn(Xe+fdLdMZ,e+fdNdOZ-dIdJdPd*Z*e.e
dQoe
/dRdSkZ0dWdTd,Z1dUd0Z2zddVlm3Z4Wnek
rHYnXd	S)XzCommon pathname manipulations, WindowsNT/95 version.

Instead of importing this module directly, import os and refer to this
module as os.path.
...\;/z.;C:\binZnulN)*normcaseisabsjoin
splitdrivesplitsplitextbasenamedirnamecommonprefixgetsizegetmtimegetatimegetctimeislinkexistslexistsisdirisfileismount
expanduser
expandvarsnormpathabspathcurdirpardirseppathsepdefpathaltsepextsepdevnullrealpathsupports_unicode_filenamesrelpathsamefilesameopenfilesamestat
commonpath
ALLOW_MISSINGcCst|trdSdSdS)N\/\/)
isinstancebytespathr5+/opt/alt/python38/lib64/python3.8/ntpath.py
_get_bothseps#s
r7cCs8t|}t|tr$|ddS|ddSdS)zaNormalize case of pathname.

    Makes all characters lowercase and all slashes into backslashes./\rrN)osfspathr1r2replacelowersr5r5r6r-s

cCsjt|}t|tr,|dddrBdSn|dddrBdSt|d}t|d	koh|d	t|kS)
zTest whether a path is absoluter8r9\\?\Trr\\?\r)	r:r;r1r2r<
startswithrlenr7r>r5r5r6r	>s

c

GsTt|}t|tr"d}d}d}nd}d}d}z|sD|dd|t|\}}ttj|D]~}t|\}}	|	r|	d|kr|s|s|}|	}q\n*|r||kr||kr|}|	}q\|}|r|d|kr||}||	}q\|r|d|kr|r|dd|kr|||WS||WSttt	fk
rNt
jd	|f|YnXdS)
Nr9r/:rr0:rr
)r:r;r1r2rmapr=	TypeErrorAttributeErrorBytesWarninggenericpath_check_arg_types)
r4pathsr!sepscolonZresult_driveZresult_pathpZp_driveZp_pathr5r5r6r
NsL



cCst|}t|dkrt|tr0d}d}d}nd}d}d}|||}|dd|dkr|dd	|kr||d}|d
kr|dd|fS|||d}||dkr|dd|fS|d
krt|}|d|||dfS|dd|kr|dd|ddfS|dd|fS)
aSplit a pathname into drive/UNC sharepoint and relative path specifiers.
    Returns a 2-tuple (drive_or_unc, path); either part may be empty.

    If you assign
        result = splitdrive(p)
    It is always true that:
        result[0] + result[1] == p

    If the path contained a drive letter, drive_or_unc will contain everything
    up to and including the colon.  e.g. splitdrive("c:/dir") returns ("c:", "/dir")

    If the path contained a UNC path, the drive_or_unc will contain the host name
    and share up to but not including the fourth directory separator character.
    e.g. splitdrive("//host/computer/dir") returns ("//host/computer", "/dir")

    Paths cannot contain both a drive letter and a UNC path.

    r9r8rErrrFrrGNrB)r:r;rDr1r2r<find)rQr!r$rPZnormpindexZindex2r5r5r6r}s.

$cCsxt|}t|}t|\}}t|}|rD||d|krD|d8}q&|d|||d}}||pj|}|||fS)z~Split a pathname.

    Return tuple (head, tail) where tail is everything after the final slash.
    Either part may be empty.rBN)r:r;r7rrDrstrip)rQrOdiheadtailr5r5r6rs

cCs8t|}t|tr$t|dddSt|dddSdS)Nr9r8.rrr)r:r;r1r2rL	_splitextrQr5r5r6r
s

cCst|dS)z)Returns the final component of a pathnamerBrr]r5r5r6rscCst|dS)z-Returns the directory component of a pathnamerr^r]r5r5r6rsc
Cs8zt|}Wntttfk
r*YdSXt|jS)zhTest whether a path is a symbolic link.
    This will always return false for Windows prior to 6.0.
    F)r:lstatOSError
ValueErrorrJstatS_ISLNKst_moder4str5r5r6rs
c	Cs.zt|}Wnttfk
r(YdSXdS)zCTest whether a path exists.  Returns True for broken symbolic linksFT)r:r_r`rarer5r5r6rs
)_getvolumepathnamecCstt|}t|}t|}t|\}}|rD|d|krD|pB||kS||krPdStrl||t||kSdSdS)zaTest whether a path is a mount point (a drive root, the root of a
    share, or a mounted volume)rTFN)r:r;r7rrrgrV)r4rOrootrestr5r5r6rs
cCst|}t|trd}nd}||s,|Sdt|}}||kr\||t|kr\|d7}q:dtjkrrtjd}nFdtjkr|Sztjd}Wntk
rd}YnXt	|tjd}t|trt
|}|dkrt	t||d|}|||dS)	zLExpand ~ and ~user constructs.

    If user or $HOME is unknown, do nothing.~~rBZUSERPROFILEZHOMEPATHZ	HOMEDRIVEN)r:r;r1r2rCrDr7environKeyErrorr
fsencoder)r4tilderXnuserhomedriver5r5r6r"s.








z.'[^']*'?|%(%|[^%]*%?)|\$(\$|[-\w]+|\{[^}]*\}?)cst|}t|trjd|kr(d|kr(|StsHddl}|t|j	j
at}ddddttddnJd|kr~d	|kr~|Stsddl}|t|j	j
at}d	d
ddtj
fdd
}|||S)zfExpand shell variables of the forms $var, ${var} and %var%.

    Unknown variables are left unchanged.$%rN{}environb$%{}cs|j}|dkr|dS||}|dkrR|kr2|S|sD|dS|dd}n4|kr^|S|r|sz|dS|dd}z.dkrttjt|WS|WSWntk
r|dYSXdS)NrrBrG)	lastindexendswithrCr:rormfsdecodern)mr}nameZbraceZdollarrmZpercentZrbracer5r6replus,


zexpandvars.<locals>.repl)r:r;r1r2_varsubbrecompile_varpatternencodeASCIIsubgetattr_varsubrm)r4rrrr5rr6rVs4

c	CsPt|}t|tr*d}d}d}d}d}nd}d}d}d	}d
}||rL|S|||}t|\}}||r||7}||}||}d}|t	|kr,||r|||kr||=q|||kr"|dkr||d|kr||d|d=|d8}n&|dkr|
|r||=n|d7}q|d7}q|sB|sB|||||S)
z0Normalize path, eliminating double slashes, etc.r9r8r[..)s\\.\r@rrrr)z\\.\rArrB)
r:r;r1r2rCr<rlstriprrDr~appendr
)	r4r!r$rr Zspecial_prefixesprefixcompsrXr5r5r6rsF









cCs@t|}t|s8t|tr&t}nt}t||}t|S)zReturn the absolute version of a path as a fallback function in case
    `nt._getfullpathname` is not available or raises OSError. See bpo-31047 for
    more.

    )	r:r;r	r1r2getcwdbgetcwdr
r)r4cwdr5r5r6_abspath_fallbacks



r)_getfullpathnamec	Cs4ztt|WSttfk
r.t|YSXdS)z&Return the absolute version of a path.N)rrr`rarr3r5r5r6rs)_getfinalpathnamereadlinkF)strictcCst|SN)r)r4rr5r5r6r'sc
Csd}t}t||kr|t|z:|}t|}t|s\t|sJ|}Wqttt||}Wq
|k
r}z|j	|krWYqW5d}~XYq
t
k
rYqYq
Xq
|S)N)rBrRrS 2CWi&i(i))setradd_nt_readlinkr	rrr
rwinerrorra)r4
ignored_errorallowed_winerrorseenZold_pathexr5r5r6_readlink_deeps&
rcCsd}d}|rzt|}|r$t||n|WS|k
r}z|j|krFz4t||d}||krx|rjt||n|WWYTSWn|k
rYnXt|\}}|r|s||WYS|rt||n|}W5d}~XYqXq|S)N)rBrRrSrrrrrr{iirlr)rr
rrr)r4rrrZrnew_pathrr5r5r6_getfinalpathname_nonstricts,
 &rc
Cst|}t|trBd}d}d}t}t|tttkrjdSn(d}d}d}t}t|ttkrjdS|	|}|t
krt}d	}n|rd
}nt}|st
|st||}zt|}d}Wn4|k
r}	z|	j}t||d}W5d}	~	XYnX|s|	|r|	|r$||t|d}
n|t|d}
zt|
|krH|
}Wn4tk
r~}	z|	j|krn|
}W5d}	~	XYnX|S)
Nr@s\\?\UNC\s\\s\\.\NULrAz\\?\UNC\z\\z\\.\NULTr5rr)rr1r2r:rrror&rrCr.FileNotFoundErrorr`r	r
rrrrD)r4rrZ
unc_prefixZnew_unc_prefixrZ
had_prefixrZinitial_winerrorrZspathr5r5r6r'HsT


getwindowsversionrSrRcCsft|}t|tr"d}d}d}nd}d}d}|dkr:|}|sFtdt|}ztt|}tt|}t|\}}t|\}	}
t|t|	krtd	|	|fd
d|	|D}dd|
	|D}d
}
t
||D]$\}}t|t|krq|
d7}
q|gt||
||
d}|s(|WSt|WSt
ttttfk
r`td||YnXdS)z#Return a relative version of a pathr9r[rrrrNzno path specifiedz&path is on mount %r, start on mount %rcSsg|]}|r|qSr5r5.0xr5r5r6
<listcomp>szrelpath.<locals>.<listcomp>cSsg|]}|r|qSr5r5rr5r5r6rsrrBr))r:r;r1r2rarrrrrziprDr
rIrJrKDeprecationWarningrLrM)r4startr!rr Z	start_absZpath_absZstart_driveZ
start_restZ
path_driveZ	path_rest
start_list	path_listrXZe1Ze2rel_listr5r5r6r)sJ




c	s|stdtttj|}t|dtr8dddndddz@fd	d
|D}fdd
|D}ztfdd
|D\}Wntk
rtddYnXttdd
|Ddkrtdt	|d
\}}|}fdd
|D}fdd
|D}t|}t
|}t|D]*\}	}
|
||	kr*|d|	}qfq*|dt|}|rt|n|}||WSttfk
rtjd|YnXdS)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencerr9r8r[rrrcs g|]}t|qSr5)rr<r=)rrQ)r$r!r5r6rszcommonpath.<locals>.<listcomp>csg|]\}}|qSr5r^rrWrQr!r5r6rsc3s"|]\}}|ddkVqdS)NrBr5rrr5r6	<genexpr>szcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNcss|]\}}|VqdSrr5rr5r5r6rsrBzPaths don't have the same drivecsg|]}|r|kr|qSr5r5rcrr5r6rscsg|]}fdd|DqS)csg|]}|r|kr|qSr5r5rrr5r6rsz)commonpath.<locals>.<listcomp>.<listcomp>r5)rr?rr5r6rsr-)r-)ratuplerHr:r;r1r2rrDrr<rminmax	enumerater
rIrJrLrM)rNZdrivesplitssplit_pathsr	rsr4commons1s2rXrrr5)r$rr!r6r-sF

)_isdir)N)5__doc__rr r%r!r"r$r#r&r:sysrbrL__all__r7rr	r
rrr
r\rrrrntrgImportErrorrrrrrrrrrrrrrr'r`rrhasattrrr(r)r-rrr5r5r5r6<module>s		
/8

0A2
*/<
84