Home | Trees | Index | Help |
---|
Package paramiko :: Class SFTPServerInterface |
|
object
--+
|
SFTPServerInterface
This class defines an interface for controlling the behavior of
paramiko when using the SFTPServer
subsystem to provide an SFTP
server.
Method Summary | |
---|---|
Create a new SFTPServerInterface object. | |
Return the canonical form of a path on the server. | |
int |
Change the attributes of a file. |
list of SFTPAttributes or error
code
|
Return a list of files within a given folder. |
SFTPAttributes or error
code
|
Return an SFTPAttributes object for a path on the
server, or an error code. |
int |
Create a new directory with the given attributes. |
Open a file on the server and create a handle for future operations on that file. | |
str or error code |
Return the target of a symbolic link (or shortcut) on the server. |
int |
Delete a file, if possible. |
int |
Rename (or move) a file. |
int |
Remove a directory if it exists. |
The SFTP server session has just ended, either cleanly or via an exception. | |
The SFTP server session has just started. | |
SFTPAttributes or error
code
|
Return an SFTPAttributes object for a path on the
server, or an error code. |
int |
Create a symbolic link on the server, as new pathname path , with target_path as the target of the
link. |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Method Details |
---|
__init__(self,
server,
*largs,
**kwargs)
Create a new SFTPServerInterface object. This method does nothing by
default and is meant to be overridden by subclasses.
|
canonicalize(self, path)Return the canonical form of a path on the server. For example, if
the server's home folder is You may find the python methods in os.path.normpath('/' +
path) .
|
chattr(self, path, attr)Change the attributes of a file. Theattr object will
contain only those fields provided by the client in its request, so you
should check for the presence of fields before using them.
|
list_folder(self, path)Return a list of files within a given folder. The The list of files is expected to be a list of SFTP_* error codes, such as SFTP_PERMISSION_DENIED .
|
lstat(self, path)Return anSFTPAttributes object for a path on the
server, or an error code. If your server supports symbolic links (also
known as "aliases"), you should not follow them --
instead, you should return data on the symlink or alias itself. (stat is the corresponding call that
follows symlinks/aliases.)
|
mkdir(self, path, attr)Create a new directory with the given attributes. The
attr object will contain only those fields provided
by the client in its request, so you should use hasattr to
check for the presense of fields before using them. In some cases, the
attr object may be completely empty.
|
open(self, path, flags, attr)Open a file on the server and create a handle for future operations
on that file. On success, a new object subclassed from flags contains the requested mode for opening
(read-only, write-append, etc) as a bitset of flags from the
os module:
(One of attr object contains requested attributes of the
file if it has to be created. Some or all attribute fields may be
missing if the client didn't specify them.
|
readlink(self, path)Return the target of a symbolic link (or shortcut) on the server. If the specified path doesn't refer to a symbolic link, an error should be returned.
|
remove(self, path)Delete a file, if possible.
|
rename(self, oldpath, newpath)Rename (or move) a file. The SFTP specification implies that this method can be used to move an existing file into a different folder, and since there's no other (easy) way to move files via SFTP, it's probably a good idea to implement "move" in this method too, even for files that cross disk partition boundaries, if at all possible.
|
rmdir(self, path)Remove a directory if it exists. Thepath should refer
to an existing, empty folder -- otherwise this method should return an
error.
|
session_ended(self)The SFTP server session has just ended, either cleanly or via an exception. This method is meant to be overridden to perform any necessary cleanup before thisSFTPServerInterface object
is destroyed.
|
session_started(self)The SFTP server session has just started. This method is meant to be overridden to perform any necessary setup before handling callbacks from SFTP operations. |
stat(self, path)Return anSFTPAttributes object for a path on the
server, or an error code. If your server supports symbolic links (also
known as "aliases"), you should follow them. (lstat is the corresponding call that
doesn't follow symlinks/aliases.)
|
symlink(self, target_path, path)Create a symbolic link on the server, as new pathnamepath , with target_path as the target of the
link.
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Sun Dec 4 11:16:48 2005 | http://epydoc.sf.net |