Package paramiko :: Module sftp_attr :: Class SFTPAttributes
[frames] | no frames]

Class SFTPAttributes

source code

object --+
         |
        SFTPAttributes

Representation of the attributes of a file (or proxied file) for SFTP in client or server mode. It attemps to mirror the object returned by `os.stat` as closely as possible, so it may have the following fields, with the same meanings as those returned by an `os.stat` object:

Because SFTP allows flags to have other arbitrary named attributes, these are stored in a dict named ``attr``. Occasionally, the filename is also stored, in ``filename``.

Instance Methods
 
__init__(self)
Create a new (empty) SFTPAttributes object.
source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
create a unix-style long description of the file (like ls -l)
source code
 
asbytes(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Methods
 
from_stat(cls, obj, filename=None)
Create an `.SFTPAttributes` object from an existing ``stat`` object (an object returned by `os.stat`).
source code
Class Variables
  FLAG_SIZE = 1
  FLAG_UIDGID = 2
  FLAG_PERMISSIONS = 4
  FLAG_AMTIME = 8
  FLAG_EXTENDED = 2147483648
Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

Create a new (empty) SFTPAttributes object. All fields will be empty.

Overrides: object.__init__

from_stat(cls, obj, filename=None)
Class Method

source code 

Create an `.SFTPAttributes` object from an existing ``stat`` object (an object returned by `os.stat`).

:param object obj: an object returned by `os.stat` (or equivalent). :param str filename: the filename associated with this file. :return: new `.SFTPAttributes` object with the same attribute fields.

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

create a unix-style long description of the file (like ls -l)

Overrides: object.__str__