U
    »åfû  ã                   @   s   d dl Z dd„ Zeƒ \ZZdS )é    Nc                     s–   t jdkr.dd l‰ dd„ } ‡ fdd„}| |fS tt jdƒrRdd	„ }d
d„ }||fS tt dƒr~tt dƒr~dd„ }dd„ }||fS dd„ }dd„ }||fS )NÚntr   c                 S   s   t  | ¡jS ©N)ÚosÚstatÚst_ctime©Úfilepath© r	   ú;/tmp/pip-unpacked-wheel-r6mt_jo5/loguru/_ctime_functions.pyÚget_ctime_windows   s    z/load_ctime_functions.<locals>.get_ctime_windowsc              	      s8   ˆ j s
d S zˆ  | |¡ W n ttfk
r2   Y nX d S r   )Z	SUPPORTEDZsetctimeÚOSErrorÚ
ValueError©r   Ú	timestamp©Úwin32_setctimer	   r
   Úset_ctime_windows   s    z/load_ctime_functions.<locals>.set_ctime_windowsÚst_birthtimec                 S   s   t  | ¡jS r   )r   r   r   r   r	   r	   r
   Úget_ctime_macos   s    z-load_ctime_functions.<locals>.get_ctime_macosc                 S   s   d S r   r	   r   r	   r	   r
   Úset_ctime_macos   s    z-load_ctime_functions.<locals>.set_ctime_macosÚgetxattrÚsetxattrc                 S   s8   zt t | d¡ƒW S  tk
r2   t | ¡j Y S X d S )Nó   user.loguru_crtime)Úfloatr   r   r   r   Úst_mtimer   r	   r	   r
   Úget_ctime_linux"   s    z-load_ctime_functions.<locals>.get_ctime_linuxc                 S   s6   zt  | dt|ƒ d¡¡ W n tk
r0   Y nX d S )Nr   Úascii)r   r   ÚstrÚencoder   r   r	   r	   r
   Úset_ctime_linux(   s    z-load_ctime_functions.<locals>.set_ctime_linuxc                 S   s   t  | ¡jS r   )r   r   r   r   r	   r	   r
   Úget_ctime_fallback0   s    z0load_ctime_functions.<locals>.get_ctime_fallbackc                 S   s   d S r   r	   r   r	   r	   r
   Úset_ctime_fallback3   s    z0load_ctime_functions.<locals>.set_ctime_fallback)r   Únamer   ÚhasattrÚstat_result)r   r   r   r   r   r   r    r!   r	   r   r
   Úload_ctime_functions   s     
	r%   )r   r%   Z	get_ctimeZ	set_ctimer	   r	   r	   r
   Ú<module>   s   5