Viewing File: /usr/lib64/python3.6/__pycache__/genericpath.cpython-36.opt-1.pyc
3
sj @ s d Z ddlZddlZddddddd d
ddd
dgZdd Zdd
Zdd Zdd Zdd Zdd Z dd Z
dd Zdd
Zdd Z
dd Zdd Zdd ZejG dd dZdS )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.
Ncommonprefixexistsgetatimegetctimegetmtimegetsizeisdirisfilesamefilesameopenfilesamestat
ALLOW_MISSINGc C s( yt j| W n tk
r" dS X dS )zDTest whether a path exists. Returns False for broken symbolic linksFT)osstatOSError)path r #/usr/lib64/python3.6/genericpath.pyr s
c C s0 yt j| }W n tk
r" dS X tj|jS )z%Test whether a path is a regular fileF)r r r S_ISREGst_mode)r str r r r s
c C s0 yt j| }W n tk
r" dS X tj|jS )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 ttfs*tttj| } t| }t| }x,t|D ] \}}||| krD|d| S qDW |S )zGGiven a list of pathnames, returns the longest common leading component r N)
isinstancelisttuplemapr fspathminmax enumerate)ms1s2icr r r r E s c C s | j |j ko| j|jkS )z5Test whether two stat buffers reference the same file)st_inost_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 )f1f2r( 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 )fp1fp2r( 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 )zSplit 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% )psepaltsepextsepsepIndexaltsepIndexdotIndex
filenameIndexr r r _splitextu s
r= c G sb d }}xB|D ]:}t |tr"d}qt |tr2d}qtd| |jjf d qW |r^|r^tdd d S )NFTz*%s() argument must be str or bytes, not %rz.Can't mix strings and bytes in path components)r strbytes TypeError __class____name__)funcnameargshasstrhasbytesr 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&