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
.
|
|
|
|
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__
|
|
FLAG_AMTIME = 8
|
|
FLAG_EXTENDED = 2147483648
|
|
FLAG_PERMISSIONS = 4
|
|
FLAG_SIZE = 1
|
|
FLAG_UIDGID = 2
|
Inherited from object :
__class__
|
Create a new (empty) SFTPAttributes object. All fields will be
empty.
- Overrides:
object.__init__
|
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.
|