Home | Trees | Index | Help |
---|
Package paramiko :: Class SFTPClient |
|
object
--+ |BaseSFTP
--+ | SFTPClient
SFTP
SFTPClient
is used to open an sftp
session across an open ssh Transport
and do remote file
operations.
Method Summary | |
---|---|
Create an SFTP client from an existing Channel . | |
__del__(self)
| |
Change the "current directory" of this SFTP session. | |
Change the mode (permissions) of a file. | |
Change the owner ( uid ) and group (gid ) of a
file. | |
Close the SFTP session and its underlying channel. | |
SFTPFile |
Open a file on the remote server. |
SFTPClient
|
Create an SFTP client channel from an open Transport . (Class method)
|
Copy a remote file ( remotepath ) from the SFTP server to
the local host as localpath . | |
str |
Return the "current working directory" for this SFTP session, as emulated by paramiko. |
list of str |
Return a list containing the names of the entries in the given path . |
list of SFTPAttributes
|
Return a list containing SFTPAttributes objects corresponding to
files in the given path . |
SFTPAttributes |
Retrieve information about a file on the remote system, without following symbolic links (shortcuts). |
Create a folder (directory) named path with numeric mode
mode . | |
str |
Return the normalized path (on the server) of a given path. |
SFTPFile |
Open a file on the remote server. |
Copy a local file ( localpath ) to the SFTP server as
remotepath . | |
str |
Return the target of a symbolic link (shortcut). |
Remove the file at the given path. | |
Rename a file or folder from oldpath to
newpath . | |
Remove the folder named path . | |
SFTPAttributes |
Retrieve information about a file on the remote system. |
Create a symbolic link (shortcut) of the source path at
destination . | |
Remove the file at the given path. | |
Set the access and modified times of the file specified by path . | |
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) |
Instance Method Details |
---|
__init__(self,
sock)
|
chdir(self, path)Change the "current directory" of this SFTP session. Since SFTP doesn't really have the concept of a current working directory, this is emulated by paramiko. Once you use this method to set a working directory, all operations on this SFTPClient object will be relative to that path.
|
chmod(self, path, mode)Change the mode (permissions) of a file. The permissions are unix-style and identical to those used by python'sos.chmod function.
|
chown(self, path, uid, gid)Change the owner (uid ) and group (gid ) of
a file. As with python's os.chown function, you must pass
both arguments, so if you only want to change one, use stat first to retrieve the current owner
and group.
|
close(self)Close the SFTP session and its underlying channel.
|
file(self, filename, mode='r', bufsize=-1)Open a file on the remote server. The arguments are the same as for
python's built-in The mode indicates how the file is to be opened: Since 1.5.2, an bufsize parameter. 0
turns off buffering, 1 uses line buffering, and any number
greater than 1 (>1 ) uses that specific buffer size.
|
get(self, remotepath, localpath)Copy a remote file (remotepath ) from the SFTP server to
the local host as localpath . Any exception raised by
operations will be passed through. This method is primarily provided as
a convenience.
|
getcwd(self)Return the "current working directory" for this SFTP session, as emulated by paramiko. If no directory has been set withchdir , this method will return
None .
|
listdir(self, path='.')Return a list containing the names of the entries in the givenpath . The list is in arbitrary order. It does not include
the special entries '.' and '..' even if they
are present in the folder. This method is meant to mirror
os.listdir as closely as possible. For a list of full SFTPAttributes objects, see listdir_attr .
|
listdir_attr(self, path='.')Return a list containingSFTPAttributes objects corresponding to
files in the given path . The list is in arbitrary order.
It does not include the special entries '.' and
'..' even if they are present in the folder.
|
lstat(self, path)Retrieve information about a file on the remote system, without following symbolic links (shortcuts). This otherwise behaves exactly the same asstat .
|
mkdir(self, path, mode=511)Create a folder (directory) namedpath with numeric
mode mode . The default mode is 0777 (octal). On some
systems, mode is ignored. Where it is used, the current umask value is
first masked out.
|
normalize(self, path)Return the normalized path (on the server) of a given path. This can be used to quickly resolve symbolic links or determine what the server is considering to be the "current folder" (by passing'.' as path ).
|
open(self, filename, mode='r', bufsize=-1)Open a file on the remote server. The arguments are the same as for
python's built-in The mode indicates how the file is to be opened: Since 1.5.2, an bufsize parameter. 0
turns off buffering, 1 uses line buffering, and any number
greater than 1 (>1 ) uses that specific buffer size.
|
put(self, localpath, remotepath)Copy a local file (
|
readlink(self, path)Return the target of a symbolic link (shortcut). You can usesymlink to create these. The result may
be either an absolute or relative pathname.
|
remove(self, path)Remove the file at the given path.
|
rename(self, oldpath, newpath)Rename a file or folder fromoldpath to
newpath .
|
rmdir(self, path)Remove the folder namedpath .
|
stat(self, path)Retrieve information about a file on the remote system. The return
value is an object whose attributes correspond to the attributes of
python's Unlike a python st_mode ,
st_size , st_uid , st_gid ,
st_atime , and st_mtime .
|
symlink(self, source, dest)Create a symbolic link (shortcut) of thesource path at
destination .
|
unlink(self, path)Remove the file at the given path.
|
utime(self, path, times)Set the access and modified times of the file specified bypath . If times is None , then the
file's access and modified times are set to the current time.
Otherwise, times must be a 2-tuple of numbers, of the form
(atime, mtime) , which is used to set the access and
modified times, respectively. This bizarre API is mimicked from python
for the sake of consistency -- I apologize.
|
Class Method Details |
---|
from_transport(selfclass, t)Create an SFTP client channel from an openTransport .
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Sun Dec 4 11:16:47 2005 | http://epydoc.sf.net |