|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /proc/self/root/lib/python2.7/site-packages/paramiko/ |
Upload File : |
�
x�\c @ sb d Z d d l Z d d l m Z m Z d d l m Z d e f d � � YZ d d l m Z d S( s7
Abstraction of an SFTP file handle (for server mode).
i����N( t SFTP_OP_UNSUPPORTEDt SFTP_OK( t ClosingContextManagert
SFTPHandlec B sk e Z d Z d d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z
d
� Z d � Z RS( s�
Abstract object representing a handle to an open file (or folder) in an
SFTP server implementation. Each handle has a string representation used
by the client to refer to the underlying file.
Server implementations can (and should) subclass SFTPHandle to implement
features of a file handle, like `stat` or `chattr`.
Instances of this class may be used as context managers.
i c C s( | | _ d | _ i | _ d | _ d S( s"
Create a new file handle representing a local file being served over
SFTP. If ``flags`` is passed in, it's used to determine if the file
is open in append mode.
:param int flags: optional flags as passed to
`.SFTPServerInterface.open`
N( t _SFTPHandle__flagst Nonet _SFTPHandle__namet _SFTPHandle__filest _SFTPHandle__tell( t selft flags( ( s8 /tmp/pip-install-A1qMVe/paramiko/paramiko/sftp_handle.pyt __init__( s c C sZ t | d d � } | d k r+ | j � n t | d d � } | d k rV | j � n d S( s
When a client closes a file, this method is called on the handle.
Normally you would use this method to close the underlying OS level
file object(s).
The default implementation checks for attributes on ``self`` named
``readfile`` and/or ``writefile``, and if either or both are present,
their ``close()`` methods are called. This means that if you are
using the default implementations of `read` and `write`, this
method's default implementation should be fine also.
t readfilet writefileN( t getattrR t close( R R R
( ( s8 /tmp/pip-install-A1qMVe/paramiko/paramiko/sftp_handle.pyR 7 s
c C s� t | d d � } | d k r"