Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/ftputil/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/ftputil/__pycache__/file.cpython-38.pyc
U

O��g�@sNdZddlZgZzddlZWnek
r4dZYnXejZGdd�d�ZdS)z=
ftputil.file - support for file-like objects on FTP servers
�Nc@sdeZdZdZdZdd�Zddd�dd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�FTPFilez�
    Represents a file-like object associated with an FTP host. File and socket
    are closed appropriately if the `close` method is called.
    �cCs$||_|j|_d|_d|_d|_dS)z!Construct the file(-like) object.TN)Z_host�_session�closed�_conn�_fobj)�self�host�r
�9/opt/cppython/lib/python3.8/site-packages/ftputil/file.py�__init__!s
zFTPFile.__init__N)�restc
	Cs
|dkrtd��d|kr$tj�d��|dkr>tj�d�|���d|krVd|krVtd	��d|k}d
|k}	|s~|dk	r~tj�d��d}
d
�|
�}tjj�|j�	|�W5QRX|	r�dnd}d�||�}tjj�|j�
||�|_W5QRX|jj|||||d�|_
d|_dS)z�
        Open the remote file with given path name and mode.

        Contrary to the `open` builtin, this method returns `None`, instead
        this file object is modified in-place.
        Nz'open() argument 2 must be str, not None�azappend mode not supported)�r�rb�rt�w�wbZwtzinvalid mode '{}'�b�tz'can't have text and binary mode at oncerz,`rest` argument can't be used for text files�IzTYPE {}ZRETRZSTORz{} {})�	buffering�encoding�errors�newlineF)�	TypeError�ftputil�error�
FTPIOError�format�
ValueErrorZCommandNotImplementedError�ftplib_error_to_ftp_io_errorr�voidcmdZtransfercmdr�makefilerr)
r�path�moderrrrr
Zis_binary_modeZis_read_modeZ
transfer_type�commandZcommand_typer
r
r�_open+s<�


�z
FTPFile._opencCs|S)z)
        Return a file iterator.
        r
�rr
r
r�__iter__fszFTPFile.__iter__cCs|��}|r|St�dS)zV
        Return the next line or raise `StopIteration`, if there are no more.
        N)�readline�
StopIteration)r�liner
r
r�__next__lszFTPFile.__next__cCs|S)Nr
r(r
r
r�	__enter__zszFTPFile.__enter__cCs|��dS)NF)�close)r�exc_type�exc_val�exc_tbr
r
r�__exit__szFTPFile.__exit__cCs*|d��krt|j|�Std�|���dS)z�
        Handle requests for attributes unknown to `FTPFile` objects: delegate
        the requests to the contained file object.
        zgencoding flush isatty fileno read readline readlines seek tell truncate name softspace write writelinesz&'FTPFile' object has no attribute '{}'N)�split�getattrr�AttributeErrorr)r�	attr_namer
r
r�__getattr__�s
�zFTPFile.__getattr__c
Cs
|jr
dS|jj��}z�|j��d|_tjj	�.t
dk	rPt|jt
�rP|j�
�|j��W5QRX|jj�|j�z"tjj	�|j��W5QRXWnTtjjk
r�}z2t|�}|dd�}|��ddkr�|dkrڂW5d}~XYnXW5|jj�|�d|_XdS)z&
        Close the `FTPFile`.
        NT�rz	timed out)Z150Z426Z450Z451)rr�sock�
gettimeout�
settimeoutrr/rrr!�	SSLSocket�
isinstancer�unwrap�_close_timeoutZvoidrespr�str�
splitlines)rZold_timeout�excZ
error_coder
r
rr/�s*



z
FTPFile.closecCstd��dS)Nzcannot serialize FTPFile object)rr(r
r
r�__getstate__�szFTPFile.__getstate__)NNNN)�__name__�
__module__�__qualname__�__doc__r@rr'r)r-r.r3r8r/rDr
r
r
rrs"�	�;
-r)rHZ
ftputil.errorr�__all__�ssl�ImportErrorr=rr
r
r
r�<module>s


F1le Man4ger