File: //usr/lib/python3.7/__pycache__/genericpath.cpython-37.pyc
B
îÇ{a” ã @ sš d Z ddlZddlZddddddd d
ddd
gZdd„ Zdd
„ Zdd „ Zdd„ Zdd„ Zdd„ Z dd„ Z
dd„ Zdd
„ Zdd„ Z
dd„ Zdd„ Zdd„ ZdS )z˜
Path operations common to more than one OS
Do not use directly. The OS specific modules import the appropriate
functions from this module themselves.
é NÚcommonprefixÚexistsÚgetatimeÚgetctimeÚgetmtimeÚgetsizeÚisdirÚisfileÚsamefileÚsameopenfileÚsamestatc C s( yt | ¡ W n tk
r" dS X dS )zDTest whether a path exists. Returns False for broken symbolic linksFT)ÚosÚstatÚOSError)Úpath© r ú!/usr/lib/python3.7/genericpath.pyr s
c C s0 yt | ¡}W n tk
r" dS X t |j¡S )z%Test whether a path is a regular fileF)r
r r ÚS_ISREGÚst_mode)r Ústr r r r s
c C s0 yt | ¡}W n tk
r" dS X t |j¡S )z<Return true if the pathname refers to an existing directory.F)r
r r ÚS_ISDIRr )Úsr r r r r ' s
c C s t | ¡jS )z1Return the size of a file, reported by os.stat().)r
r Úst_size)Úfilenamer r r r 0 s c C s t | ¡jS )zCReturn the last modification time of a file, reported by os.stat().)r
r Úst_mtime)r r r r r 5 s c C s t | ¡jS )z=Return the last access time of a file, reported by os.stat().)r
r Úst_atime)r r r r r : s c C s t | ¡jS )zAReturn the metadata change time of a file, reported by os.stat().)r
r Úst_ctime)r r r r r ? s c C sl | sdS t | d ttfƒs*tttj| ƒƒ} t| ƒ}t| ƒ}x,t|ƒD ] \}}||| krD|d|… S qDW |S )zGGiven a list of pathnames, returns the longest common leading componentÚ r N) Ú
isinstanceÚlistÚtupleÚmapr
ÚfspathÚminÚmaxÚ enumerate)ÚmÚs1Ús2ÚiÚcr r r r E s c C s | j |j ko| j|jkS )z5Test whether two stat buffers reference the same file)Úst_inoÚst_dev)r' r( r r r r W s c C s t | ¡}t |¡}t||ƒS )z9Test whether two pathnames reference the same actual file)r
r r )Úf1Úf2r' r( r r r r
^ s
c C s t | ¡}t |¡}t||ƒS )z:Test whether two open file objects reference the same file)r
Úfstatr )Úfp1Úfp2r' r( r r r r g s
c C sŽ | |¡}|r"| |¡}t||ƒ}| |¡}||kr~|d }x@||k r|| ||d … |krr| d|… | |d… fS |d7 }q>W | | dd… fS )z¤Split the extension from a pathname.
Extension is everything from the last dot to the end, ignoring
leading dots. Returns "(root, ext)"; ext may be empty.é Nr )Úrfindr$ )ÚpÚsepÚaltsepÚextsepÚsepIndexÚaltsepIndexÚdotIndexÚ
filenameIndexr r r Ú _splitextu s
r<