
    do                     p    d Z ddlZddlZg dZd Zd Zd Zd Zd Zd	 Z	d
 Z
d Zd Zd Zd Zd Z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                 b    	 t          j        |            n# t          t          f$ r Y dS w xY wdS )zDTest whether a path exists.  Returns False for broken symbolic linksFT)osstatOSError
ValueError)paths      /croot/python-split_1694437901252/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib/python3.11/genericpath.pyr   r      sB    
Z    uu4    ,,c                     	 t          j        |           }n# t          t          f$ r Y dS w xY wt          j        |j                  S )z%Test whether a path is a regular fileF)r   r   r   r   S_ISREGst_mode)r   sts     r   r
   r
      sO    WT]]Z    uu<
###r   c                     	 t          j        |           }n# t          t          f$ r Y dS w xY wt          j        |j                  S )z<Return true if the pathname refers to an existing directory.F)r   r   r   r   S_ISDIRr   )sr   s     r   r	   r	   '   sO    WQZZZ    uu<
###r   c                 4    t          j        |           j        S )z1Return the size of a file, reported by os.stat().)r   r   st_sizefilenames    r   r   r   0   s    78$$    c                 4    t          j        |           j        S )zCReturn the last modification time of a file, reported by os.stat().)r   r   st_mtimer   s    r   r   r   5       78%%r!   c                 4    t          j        |           j        S )z=Return the last access time of a file, reported by os.stat().)r   r   st_atimer   s    r   r   r   :   r$   r!   c                 4    t          j        |           j        S )zAReturn the metadata change time of a file, reported by os.stat().)r   r   st_ctimer   s    r   r   r   ?   r$   r!   c                 6   | sdS t          | d         t          t          f          s't          t          t          j        |                     } t          |           }t          |           }t          |          D ]\  }}|||         k    r|d|         c S |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cs        r   r   r   E   s    RR
 adT5M** %#bi##$$	QB	QB"  11::bqb6MMM Ir!   c                 B    | j         |j         k    o| j        |j        k    S )z5Test whether two stat buffers reference the same file)st_inost_dev)r4   r5   s     r   r   r   W   s$    I" #I"$r!   c                 r    t          j        |           }t          j        |          }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   )f1f2r4   r5   s       r   r   r   ^   s.     
B	BBr!   c                 r    t          j        |           }t          j        |          }t          ||          S )z:Test whether two open file objects reference the same file)r   fstatr   )fp1fp2r4   r5   s       r   r   r   k   s,    	#B	#BBr!   c                 >   |                      |          }|r%|                      |          }t          ||          }|                      |          }||k    r;|dz   }||k     r0| ||dz            |k    r| d|         | |d         fS |dz  }||k     0| | dd         fS )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   )rfindr1   )psepaltsepextsepsepIndexaltsepIndexdotIndexfilenameIndexs           r   	_splitextrM   y   s     wws||H .ggfoox--wwvH( 1h&&}Q./699(|Qxyy\11QM h&&
 ae8Or!   c                     dx}}|D ]P}t          |t                    rd}t          |t                    rd}2t          |  d|j        j                  d |r|rt          d          d d S d S )NFTz;() argument must be str, bytes, or os.PathLike object, not z.Can't mix strings and bytes in path components)r+   strbytes	TypeError	__class____name__)funcnameargshasstrhasbytesr   s        r   _check_arg_typesrX      s    FX [ [a 	[FF5!! 	[HHx P P78{7KP P Q QVZ[ T( THIItST T T Tr!   )__doc__r   r   __all__r   r
   r	   r   r   r   r   r   r   r   r   rM   rX    r!   r   <module>r\      s   
 
			     $ $ $$ $ $% % %
& & &
& & &
& & &  $$ $ $      .T T T T Tr!   