
    F\hg                         S r SSKrSSKr/ SQrS rS rS rS rS rS	 r	S
 r
S rS rS rS rS rS rS rS rS rS r\R,                   " S S5      5       rg)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
isdevdriveisdirisfile
isjunctionislinklexistssamefilesameopenfilesamestatALLOW_MISSINGc                 ^     [         R                  " U 5        g! [        [        4 a     gf = f)zDTest whether a path exists.  Returns False for broken symbolic linksFT)osstatOSError
ValueErrorpaths    "/usr/lib/python3.13/genericpath.pyr   r      s0    
  Z      ,,c                 ^     [         R                  " U 5        g! [        [        4 a     gf = f)zCTest whether a path exists.  Returns True for broken symbolic linksFT)r   lstatr   r   r   s    r   r   r      s0    
  Z  r   c                      [         R                  " U 5      n[        R                  " UR
                  5      $ ! [        [        4 a     gf = f)z%Test whether a path is a regular fileF)r   r   r   r   S_ISREGst_moder   sts     r   r   r   $   sB    WWT] <<

## Z     8 A
Ac                      [         R                  " U 5      n[        R                  " UR
                  5      $ ! [        [        4 a     gf = f)z<Return true if the pathname refers to an existing directory.F)r   r   r   r   S_ISDIRr    )sr"   s     r   r
   r
   0   sB    WWQZ <<

## Z  r#   c                      [         R                  " U 5      n[
        R                  " UR                  5      $ ! [        [        [        4 a     gf = f)z&Test whether a path is a symbolic linkF)r   r   r   r   AttributeErrorr   S_ISLNKr    r!   s     r   r   r   <   sD    XXd^ <<

## Z0 s   8 AAc                 0    [         R                  " U 5        g)zUTest whether a path is a junction
Junctions are not supported on the current platformFr   fspathr   s    r   r   r   F        IIdO    c                 0    [         R                  " U 5        g)zuDetermines whether the specified path is on a Windows Dev Drive.
Dev Drives are not supported on the current platformFr+   r   s    r   r	   r	   M   r-   r.   c                 B    [         R                  " U 5      R                  $ )z1Return the size of a file, reported by os.stat().)r   r   st_sizefilenames    r   r   r   T   s    778$$$r.   c                 B    [         R                  " U 5      R                  $ )zCReturn the last modification time of a file, reported by os.stat().)r   r   st_mtimer2   s    r   r   r   Y       778%%%r.   c                 B    [         R                  " U 5      R                  $ )z=Return the last access time of a file, reported by os.stat().)r   r   st_atimer2   s    r   r   r   ^   r6   r.   c                 B    [         R                  " U 5      R                  $ )zAReturn the metadata change time of a file, reported by os.stat().)r   r   st_ctimer2   s    r   r   r   c   r6   r.   c                 
   U (       d  g[        U S   [        [        45      (       d#  [        [        [        R
                  U 5      5      n [        U 5      n[        U 5      n[        U5       H  u  p4XBU   :w  d  M  USU s  $    U$ )zGGiven a list of pathnames, returns the longest common leading component r   N)	
isinstancelisttuplemapr   r,   minmax	enumerate)ms1s2ics        r   r   r   i   sp    R
 adT5M**#bii#$	QB	QB"1:bq6M  Ir.   c                 t    U R                   UR                   :H  =(       a    U R                  UR                  :H  $ )z5Test whether two stat buffers reference the same file)st_inost_dev)rE   rF   s     r   r   r   {   s,    II" #II"$r.   c                 p    [         R                  " U 5      n[         R                  " U5      n[        X#5      $ )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f2rE   rF   s       r   r   r      s)     
B	BBr.   c                 p    [         R                  " U 5      n[         R                  " U5      n[        X#5      $ )z:Test whether two open file objects reference the same file)r   fstatr   )fp1fp2rE   rF   s       r   r   r      s'    	#B	#BBr.   c                     U R                  U5      nU(       a  U R                  U5      n[        XE5      nU R                  U5      nXd:  a*  US-   nXv:  a   XUS-    U:w  a	  U SU XS 4$ US-  nXv:  a  M   X SS 4$ )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   )rfindrB   )psepaltsepextsepsepIndexaltsepIndexdotIndexfilenameIndexs           r   	_splitextr^      s     wws|Hggfox-wwvH 1&}Q/69(|Qy\11QM &
 e8Or.   c                     S=p#U HY  n[        U[        5      (       a  SnM  [        U[        5      (       a  SnM5  [        U  SUR                  R
                  < 35      S e   U(       a  U(       a  [        S5      S eg g )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_typesri      s    FaF5!!Hxj )778{{7K7K6NP QVZ[  (HItS vr.   c                   $    \ rS rSrSrS rS rSrg)r      z$Special value for use in realpath().c                     g)Nzos.path.ALLOW_MISSING selfs    r   __repr__ALLOW_MISSING.__repr__   s    &r.   c                 .    U R                   R                  $ )N)rc   rd   rn   s    r   
__reduce__ALLOW_MISSING.__reduce__   s    ~~&&&r.   rm   N)rd   
__module____qualname____firstlineno____doc__rp   rs   __static_attributes__rm   r.   r   r   r      s    .''r.   r   )rx   r   r   __all__r   r   r   r
   r   r   r	   r   r   r   r   r   r   r   r   r^   ri   object__new__r   rm   r.   r   <module>r}      s   
 
 O$$$%
&
&
&$$.T ' ' 'r.   