Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/twisted/python/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/twisted/python/__pycache__/lockfile.cpython-310.pyc
o

�bZ�@s�dZddlZddlZddlmZddlmZdd�ZddlmZe�	�s3ddlm
Z
mZmZ
mZd	Zn0d
ZzddlZddlmZWneyLdZ
Yn	wdZd
Zdd�Z
eZdd�Zdd�Zdd�Z
Gdd�d�Zdd�ZddgZdS)z&
Filesystem-based interprocess mutex.
�N)�time)�platformcCsttt�d��S)Ni�)�str�int�_uniquefloat�rr�9/usr/lib/python3/dist-packages/twisted/python/lockfile.py�uniquesr	)�rename)�kill�readlink�remove�symlinkFT)�OpenProcess��Wc
Csjztdd|�Wt	d��tjy4}z|jdtkr"WYd}~dS|jdtkr/ttjd���d}~ww)Nrz OpenProcess is required to fail.)
r�
pywintypes�error�args�ERROR_ACCESS_DENIED�ERROR_INVALID_PARAMETER�OSError�errno�ESRCH�RuntimeError)�pid�signal�errrr4s���rcCs�|dt�d}tj�|d�}t�|�d}t||��}|�|�|��Wd�n1s0wYzt||�WdSt	yOt�
|�t�|��w)z�
        Write a file at C{filename} with the contents of C{value}. See the
        above comment block as to why this is needed.
        �.z.newlinkr�wN)r	�os�path�join�mkdir�_open�write�flushr
�
BaseExceptionr
�rmdir)�value�filename�newlinkname�
newvalname�mode�frrrrEs


�

�rc
Cs�zttj�|d�d�}Wnty+}z|jtjks |jtjkr&t|jd���d}~ww|�
|��}Wd�|S1s>wY|S)zq
        Read the contents of C{filename}. See the above comment block as to why
        this is needed.
        r�rN)	r$r r!r"rr�ENOENT�EIO�read)r*�fObjr�resultrrrr`s��

��rcCs"t�tj�|d��t�|�dS)Nr)r r
r!r"r()r*rrr�rmlinkrsr5c@s0eZdZdZdZdZdd�Zdd�Zdd	�ZdS)
�FilesystemLocka
    A mutex.

    This relies on the filesystem property that creating
    a symlink is an atomic operation and that it will
    fail if the symlink already exists.  Deleting the
    symlink will release the lock.

    @ivar name: The name of the file associated with this lock.

    @ivar clean: Indicates whether this lock was released cleanly by its
        last owner.  Only meaningful after C{lock} has been called and
        returns True.

    @ivar locked: Indicates whether the lock is currently held by this
        object.
    NFcCs
||_dS)N)�name)�selfr7rrr�__init__�s
zFilesystemLock.__init__cCs�d}	zttt���|j�Wn�ty�}z�tr)|jtjtj	fvr)WYd}~dS|jtj
kr�zt|j�}Wn2tyh}z&|jtjkrOWYd}~WYd}~qtrc|jtjkrcWYd}~WYd}~dS�d}~wwz
t
durut
t|�d�WnKty�}z?|jtjkr�zt|j�Wn#ty�}z|jtjkr�WYd}~WYd}~WYd}~q�d}~wwd}WYd}~WYd}~q�d}~wwWYd}~dS�d}~wwd|_||_dS)z�
        Acquire this lock.

        @rtype: C{bool}
        @return: True if the lock is acquired, false otherwise.

        @raise OSError: Any exception L{os.symlink()} may raise,
            other than L{errno.EEXIST}.
        TNFr)rrr �getpidr7r�_windowsr�EACCESr1�EEXISTrr0rrrr5�locked�clean)r8r?rrrrr�lock�sX
��
� ������+zFilesystemLock.lockcCs@t|j�}t|�t��krtd|j�d���t|j�d|_dS)z�
        Release this lock.

        This deletes the directory with the given name.

        @raise OSError: Any exception L{os.readlink()} may raise.
        @raise ValueError: If the lock is not owned by this process.
        zLock z not owned by this processFN)rr7rr r:�
ValueErrorr5r>)r8rrrr�unlock�s

	

zFilesystemLock.unlock)	�__name__�
__module__�__qualname__�__doc__r?r>r9r@rBrrrrr6ws=r6cCs:t|�}d}z|��}W|r|��|S|r|��ww)z�
    Determine if the lock of the given name is held or not.

    @type name: C{str}
    @param name: The filesystem path to the lock to test

    @rtype: C{bool}
    @return: True if the lock is held, False otherwise.
    N)r6r@rB)r7�lr4rrr�isLocked�s

�
�rH)rFrr rr�twisted.python.runtimerr	r
�	isWindowsrrr
r5rr;r�win32apir�ImportErrorrr�openr$r6rH�__all__rrrr�<module>s6�
f

Spamworldpro Mini