o
    2cq                     @   sJ   d dl Z d dlZd dlZd dlmZ e ZedZG dd de	Z
dS )    N)utilCYGWINc                   @   s4   e Zd Zdd Zdd Zdd Zdd Zd	d
 ZdS )	WorkerTmpc                 C   s   t |j}|j}|rt j|std| tjd|d\}}t | |jt 	 ks3|j
t  kr<t||j|j
 ztsDt| t |dd| _W n tyZ   t |  w d| _d S )Nz)%s doesn't exist. Can't create workertmp.z
wgunicorn-)prefixdirzw+br   )osumaskworker_tmp_dirpathisdirRuntimeErrortempfilemkstempuidgeteuidgidgetegidr   chown	IS_CYGWINunlinkfdopen_tmp	Exceptionclosespinner)selfcfg	old_umaskfdirfdname r!   P/var/www/html/gps/gps/lib/python3.10/site-packages/gunicorn/workers/workertmp.py__init__   s"   



zWorkerTmp.__init__c                 C   s(   | j d d | _ t| j | j  d S )N      )r   r   fchmodr   filenor   r!   r!   r"   notify,   s   zWorkerTmp.notifyc                 C   s   t | j jS N)r   fstatr   r'   st_ctimer(   r!   r!   r"   last_update0   s   zWorkerTmp.last_updatec                 C   
   | j  S r*   )r   r'   r(   r!   r!   r"   r'   3      
zWorkerTmp.filenoc                 C   r.   r*   )r   r   r(   r!   r!   r"   r   6   r/   zWorkerTmp.closeN)__name__
__module____qualname__r#   r)   r-   r'   r   r!   r!   r!   r"   r      s    r   )r   platformr   gunicornr   systemPLATFORM
startswithr   objectr   r!   r!   r!   r"   <module>   s   
