î
ù-X*  ã               @   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 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 |  ƒ Wn t k
 r) d SYn Xd S)zDTest whether a path exists.  Returns False for broken symbolic linksFT)ÚosÚstatÚOSError)Úpath© r   ú;/home/kubikplay/www/django_dtb/lib/python3.4/genericpath.pyr      s
    	c             C   s<   y t  j |  ƒ } Wn t k
 r+ d SYn Xt 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   s<   y t  j |  ƒ } Wn t k
 r+ d SYn Xt 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   sa   |  s
 d St  |  ƒ } t |  ƒ } x8 t | ƒ D]* \ } } | | | k r/ | d | … Sq/ W| S)zGGiven a list of pathnames, returns the longest common leading componentÚ N)Ú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   Q   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
   X   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   a   s    c             C   sÇ   |  j  | ƒ } | r6 |  j  | ƒ } t | | ƒ } n  |  j  | ƒ } | | k r³ | d } xU | | k  r¯ |  | | d … | k r¢ |  d | … |  | d … f S| d 7} q^ Wn  |  |  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   Ú	_splitexto   s    
r/   )Ú__doc__r   r   Ú__all__r   r	   r   r   r   r   r   r   r   r
   r   r/   r   r   r   r   Ú<module>   s"   			