https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/mercurial/pure/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/mercurial/pure/__pycache__/osutil.cpython-310.pyc
o

�]LbC%�@s�ddlmZmZddlZddlZddlZddlZddlZddl	m
Z
ddlmZm	Z	dd�Z
d+d	d
�Ze	js�eZdZejZe	j�d�rMejZejZejZneZeZejZGd
d�dej�ZGdd�dej�ZGdd�dej�Zej ej!�"d�dd�Z#e
e#dd�Z$e$r�e
edej%�e$_&eje�'e�ejfe$_(ndd�Z$dd�Z)dd�Z*dSddl+Z+ej,j-Z.ej/Z0ej1Z2Z3ej4Z5e5d�j6Z7dZ8dZ9dZ:dZ;d Z<dZ=d!Z>d"Z?d#Z@dZAdZBd$ZCd%ZDd&ZEe2e0e0ej4e0e0e5ge.jF_(e5e.jF_&d'd(�ZGGd)d*�d*eH�ZdS),�)�absolute_import�divisionN�)�getattr)�encoding�pycompatcCstt�|�rtjSt�|�rtjSt�|�rtjSt�|�r tjSt�	|�r(tj
St�|�r0tjSt�
|�r8tjS|S�N)�statmod�S_ISREG�S_IFREG�S_ISDIR�S_IFDIR�S_ISLNK�S_IFLNK�S_ISBLK�S_IFBLK�S_ISCHR�S_IFCHR�S_ISFIFO�S_IFIFO�S_ISSOCK�S_IFSOCK)�mode�r�7/usr/lib/python3/dist-packages/mercurial/pure/osutil.py�
_mode_to_kinds






rFcCs�g}|}|�tj�s|tj7}t�|�}|��|D]/}t�||�}||kr1t�|j	�r1gS|r?|�
|t|j	�|f�q|�
|t|j	�f�q|S)alistdir(path, stat=False) -> list_of_tuples

    Return a sorted list containing information about the entries
    in the directory.

    If stat is True, each element is a 3-tuple:

      (name, type, stat object)

    Otherwise, each element is a 2-tuple:

      (name, type)
    )�endswithr�ossep�os�listdir�sort�lstatr	r�st_mode�appendr)�path�stat�skip�result�prefix�names�fn�strrrr)s

r�slinuxc@s eZdZdejfdejfgZdS)�_iovec�iov_base�iov_lenN)�__name__�
__module__�__qualname__�ctypes�c_void_p�c_size_t�_fields_rrrrr-Ys�r-c@sFeZdZdejfdefde�e�fdefdejfde	fdej
fgZdS)	�_msghdr�msg_name�msg_namelen�msg_iov�
msg_iovlen�msg_control�msg_controllen�	msg_flagsN)r0r1r2r3r4�
_socklen_t�POINTERr-�
_msg_iovlen_t�_msg_controllen_t�c_intr6rrrrr7_s�r7c@s2eZdZdefdejfdejfdejdfgZdS)�_cmsghdr�cmsg_len�
cmsg_level�	cmsg_type�	cmsg_datarN)r0r1r2�_cmsg_len_tr3rC�c_ubyter6rrrrrDjs�rD�cT)�	use_errno�recvmsg�	c_ssize_tcCstd��)Nsunsupported platform)�NotImplementedError)�sockfd�msg�flagsrrr�_recvmsg}srScCs.|jt�t�kr
dSt�|jt�t��}|jSr)r=r3�sizeofrD�castr<r@�contents)�msgh�cmsgptrrrr�_CMSG_FIRSTHDR�srYc		s�tjd�}tt�|tj�t�|��}t�d�}tddt�|�dt�|tj�t�|�d�}t	|t�
|�d�}|dkrFt��}t|t
�|���t|�}|sNgS|jtjksY|jtkr[gSt�|jt�tj���|jtjjt�tj�}�fdd�t�|�D�S)z+receive list of file descriptors via socketr,�Nrcsg|]}�|�qSrr)�.0�i��rfdsrr�
<listcomp>�szrecvfds.<locals>.<listcomp>)r3rJr-rUr4rT�create_string_bufferr7�pointerrS�byref�	get_errno�OSErrorr�strerrorrYrF�socket�
SOL_SOCKETrG�_SCM_RIGHTSrHr@rCrErD�offsetr�xrange)	rP�dummy�iov�cbufrW�r�e�cmsg�	rfdscountrr]r�recvfds�s6
�	

�rr�����li@��i@i�cCs$t��}t|jdt�|�|jf��)Nz%s: %s)r3�WinError�IOError�errnor�strfromlocalre)�name�errrrr�
_raiseioerror�s�r~c@sBeZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�	posixfileaka file object aiming for POSIX-like semantics

        CPython's open() returns a file that was opened *without* setting the
        _FILE_SHARE_DELETE flag, which causes rename and unlink to abort.
        This even happens if any hardlinked copy of the file is in open state.
        We set _FILE_SHARE_DELETE here, so files opened with posixfile can be
        renamed and deleted while they are held open.
        Note that if a file opened with posixfile is unlinked, the file
        remains but cannot be opened again or be recreated under the same name,
        until all reading processes have closed the file.�rrsc	Csd|vrt}nt}|dd�}|dkrd|vr|tO}t}n|tO}ttB}|dkr-t}n|dkr4t}n|dkr?t}|t	O}n	t
dt�|���t
�||ttBtBd|td�}|tkr_t|�t�||�}	|	d	krrt
�|�t|�t�|	t�|�|�}
t�|d
|�t�|d|
�dS)N�brr,r��+�w�azinvalid mode: %srsr|�_file)�	_O_BINARY�_O_TEXT�	_O_RDONLY�
_GENERIC_READ�_O_RDWR�_GENERIC_WRITE�_OPEN_EXISTING�_CREATE_ALWAYS�_OPEN_ALWAYS�	_O_APPEND�
ValueErrorr�sysstr�	_kernel32�CreateFileA�_FILE_SHARE_READ�_FILE_SHARE_WRITE�_FILE_SHARE_DELETE�_FILE_ATTRIBUTE_NORMAL�_INVALID_HANDLE_VALUEr~�msvcrt�open_osfhandle�CloseHandler�fdopen�object�__setattr__)�selfr|r�bufsizerR�m0�access�creation�fh�fd�frrr�__init__�sF

�	
zposixfile.__init__cCs|jSr)r��r�rrr�__iter__szposixfile.__iter__cCst|j|�Sr)rr�)r�r|rrr�__getattr__!szposixfile.__getattr__cCs|j�||�S)z�mimics the read-only attributes of Python file objects
            by raising 'TypeError: readonly attribute' if someone tries:
              f = posixfile('foo.txt')
              f.name = 'bla'
            )r�r�)r�r|�valuerrrr�$szposixfile.__setattr__cCs|j��|Sr)r��	__enter__r�rrrr�,s
zposixfile.__enter__cCs|j�|||�Sr)r��__exit__)r��exc_type�	exc_value�exc_tbrrrr�0szposixfile.__exit__N)r�rs)
r0r1r2�__doc__r�r�r�r�r�r�rrrrr�s
2r)FN)I�
__future__rrr3�ctypes.utilrrfr%r	rr�rrr�	iswindows�openrrh�c_uintr?�sysplatform�
startswithr5rIrBrArC�	Structurer-r7rD�CDLL�util�find_library�_libcrS�c_long�restyper@�argtypesrYrrr��windll�kernel32r��c_ulong�_DWORD�c_char_p�_LPCSTR�_LPSTRr4�_HANDLEr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r~r�rrrr�<module>s�
�	$

�	

https://t.me/RX1948 - 2025