paramiko.SFTPAttributes

Package paramiko :: 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:

- st_size
- st_uid
- st_gid
- st_mode
- st_atime
- st_mtime

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
Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`

Class Methods
SFTPAttributes |
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_AMTIME = `8`
| FLAG_EXTENDED = `2147483648`
| FLAG_PERMISSIONS = `4`
| FLAG_SIZE = `1`
| FLAG_UIDGID = `2`

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__

### __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__

### 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`). Parameters: `obj` (object) - an object returned by `os.stat` (or equivalent). `filename` (str) - the filename associated with this file. Returns: SFTPAttributes new SFTPAttributes object with the same attribute fields.