File: //usr/lib64/python3.6/__pycache__/genericpath.cpython-36.pyc
3
„ƒÎi¤ ã @ s° d Z ddlZddlZddddddd d
ddd
dgZdd„ Zdd
„ Zdd „ Zdd„ Zdd„ Zdd„ Z dd„ Z
dd„ Zdd
„ Zdd„ Z
dd„ Zdd„ Zdd„ ZejG dd„ dƒƒ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ÚsamestatÚ
ALLOW_MISSINGc C s( yt j| ƒ W n tk
r" dS X dS )zDTest whether a path exists. Returns False for broken symbolic linksFT)ÚosÚstatÚOSError)Úpath© r ú#/usr/lib64/python3.6/genericpath.pyr s
c C s0 yt j| ƒ}W n tk
r" dS X tj|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 j| ƒ}W n tk
r" dS X tj|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 j| ƒ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 j| ƒ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 j| ƒ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 j| ƒ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 j| ƒ}t j|ƒ}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 j| ƒ}t j|ƒ}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Ž | j |ƒ}|r"| j |ƒ}t||ƒ}| j |ƒ}||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= c G sb d }}xB|D ]:}t |tƒr"d}qt |tƒr2d}qtd| |jjf ƒd ‚qW |r^|r^tdƒd ‚d S )NFTz*%s() argument must be str or bytes, not %rz.Can't mix strings and bytes in path components)r ÚstrÚbytesÚ TypeErrorÚ __class__Ú__name__)ÚfuncnameÚargsÚhasstrÚhasbytesr r r r Ú_check_arg_typesŒ s
rG c @ s e Zd ZdZdd„ Zdd„ ZdS )r
z$Special value for use in realpath().c C s dS )Nzos.path.ALLOW_MISSINGr )Úselfr r r Ú__repr__ž s zALLOW_MISSING.__repr__c C s | j jS )N)rA rB )rH r r r Ú
__reduce__ s zALLOW_MISSING.__reduce__N)rB Ú
__module__Ú__qualname__Ú__doc__rI rJ r r r r r
› s )rM r r Ú__all__r r r r r r r r r r
r r= rG ÚobjectÚ__new__r
r r r r Ú<module> s&