3
4^š^”  ã               @   sš   d Z ddlZddlZddddddd	d
dddgZdd„ Zdd
„ Zdd	„ Zdd„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )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(   yt j| ƒ W n tk
r"   dS X dS )zDTest whether a path exists.  Returns False for broken symbolic linksFT)ÚosÚstatÚOSError)Úpath© r   úr/home/aldo/Documentos/tesis/tesis/device auto/pruebas pulsar/pruebaclonado/envClonado/lib/python3.6/genericpath.pyr      s
    c             C   s0   yt j| ƒ}W n tk
r"   dS X tj|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   yt j| ƒ}W n tk
r"   dS X tj|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| ƒjS )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| ƒjS )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| ƒjS )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| ƒjS )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   | sdS t | d ttfƒs*tttj| ƒƒ} t| ƒ}t| ƒ}x,t|ƒD ] \}}||| krD|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 ko| j|jkS )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   )Zf1Z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   )Zfp1Zfp2r'   r(   r   r   r   r   g   s    

c             C   sŽ   | j |ƒ}|r"| j |ƒ}t||ƒ}| j |ƒ}||kr~|d }x@||k r|| ||d … |krr| d|… | |d… fS |d7 }q>W | | dd… fS )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ÚextsepZsepIndexZaltsepIndexZdotIndexZfilenameIndexr   r   r   Ú	_splitextu   s    




r4   c             G   sb   d }}xB|D ]:}t |tƒr"d}qt |tƒr2d}qtd| |jjf ƒd ‚qW |r^|r^tdƒ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__)ZfuncnameÚargsZhasstrZhasbytesr   r   r   r   Ú_check_arg_typesŒ   s    


r;   )Ú__doc__r   r   Ú__all__r   r	   r   r   r   r   r   r   r   r
   r   r4   r;   r   r   r   r   Ú<module>   s$   

		