%PDF- %PDF-
Direktori : /usr/local/lib/python3.8/__pycache__/ |
Current File : //usr/local/lib/python3.8/__pycache__/genericpath.cpython-38.pyc |
U nao @ 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. Ncommonprefixexistsgetatimegetctimegetmtimegetsizeisdirisfilesamefilesameopenfilesamestatc C s. zt | W n ttfk r( Y dS X dS )zDTest whether a path exists. Returns False for broken symbolic linksFT)osstatOSError ValueError)path r '/usr/local/lib/python3.8/genericpath.pyr s c C s6 zt | }W n ttfk r( Y dS X t|jS )z%Test whether a path is a regular fileF)r r r r S_ISREGst_mode)r str r r r s c C s6 zt | }W n ttfk r( Y dS X t|jS )z<Return true if the pathname refers to an existing directory.F)r 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_sizefilenamer 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_mtimer 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_atimer 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_ctimer r r r r ? s c C sl | sdS t | d ttfs*tttj| } t| }t| }t|D ]$\}}||| krB|d| S qB|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 | }t |}t||S )zTest whether two pathnames reference the same actual file or directory This is determined by the device number and i-node number and raises an exception if an os.stat() call on either pathname fails. )r r r )f1f2r) 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 )fp1fp2r) r* r r r r k s c C s | |}|r"| |}t||}| |}||krz|d }||k rz| ||d |krp| d| | |d fS |d7 }q<| | 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&