Home | Trees | Index | Help |
---|
Package paramiko :: Class SFTPFile |
|
object
--+ |BufferedFile
--+ | SFTPFile
Method Summary | |
---|---|
__init__(self,
sftp,
handle,
mode,
bufsize)
| |
__del__(self)
| |
str |
Ask the server for a hash of a section of this file. |
Close the file. | |
float |
Returns the timeout in seconds (as a float) associated with the socket or ssh Channel used for this file. |
Pre-fetch the remaining contents of this file in anticipation of future read calls. | |
Set the file's current position, like stdio's fseek . | |
Turn on/off the pipelining of write operations to this file. | |
Set blocking or non-blocking mode on the underiying socket or ssh Channel . | |
Set a timeout on read/write operations on the underlying socket or ssh Channel . | |
SFTPAttributes |
Retrieve information about this file from the remote system. |
_async_response(self,
t,
msg)
| |
if there's a saved exception, raise & clear it | |
(subclass override) Return the size of the file. | |
_prefetch(self)
| |
(subclass override) Read data from the stream. | |
_read_prefetch(self,
size)
| |
(subclass override) Write data into the stream. | |
Inherited from BufferedFile | |
iterator |
Returns an iterator that can be used to iterate over the lines in this file. |
Write out any data in the write buffer. | |
str |
Returns the next line from the input, or raises StopIteration when EOF is hit. |
str |
Read at most size bytes from the file (less if we hit the
end of the file first). |
str |
Read one entire line from the file. |
list |
Read all remaining lines using readline and return them as a list. |
int |
Return the file's current position. |
Write data to the file. | |
Write a sequence of strings to the file. | |
iterator |
Identical to iter(f) . |
| |
Subclasses call this method to initialize the BufferedFile. | |
| |
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) |
Class Variable Summary | |
---|---|
int |
MAX_REQUEST_SIZE = 32768 |
Inherited from BufferedFile | |
int |
SEEK_CUR = 1 |
int |
SEEK_END = 2 |
int |
SEEK_SET = 0 |
int |
_DEFAULT_BUFSIZE = 8192 |
Method Details |
---|
check(self, hash_algorithm, offset=0, length=0, block_size=0)Ask the server for a hash of a section of this file. This can be used to verify a successful upload or download, or for various rsync-like operations. The file is hashed from Normally, check('sha1', 0, 1024, 512) will return a
string of length 40. The first 20 bytes will be the SHA-1 of the first
512 bytes of the file, and the last 20 bytes will be the SHA-1 of the
next 512 bytes.
|
close(self, _async=False)Close the file. Future read and write operations will fail.
|
gettimeout(self)Returns the timeout in seconds (as a float) associated with the socket or sshChannel used for this file.
|
prefetch(self)Pre-fetch the remaining contents of this file in anticipation of futureread calls. If reading the entire file,
pre-fetching can dramatically improve the download speed by avoiding
roundtrip latency. The file's contents are incrementally buffered in a
background thread.
|
seek(self, offset, whence=0)Set the file's current position, like stdio'sfseek .
Not all file objects support seeking.
|
set_pipelined(self, pipelined=True)Turn on/off the pipelining of write operations to this file. When
pipelining is on, paramiko won't wait for the server response after
each write operation. Instead, they're collected as they come in. At
the first non-write operation (including
|
setblocking(self, blocking)Set blocking or non-blocking mode on the underiying socket or sshChannel .
|
settimeout(self, timeout)Set a timeout on read/write operations on the underlying socket or sshChannel .
|
stat(self)Retrieve information about this file from the remote system. This is exactly likeSFTP.stat , except that it operates on an
already-open file.
|
_check_exception(self)if there's a saved exception, raise & clear it |
_get_size(self)(subclass override) Return the size of the file. This is called from within_set_mode if the file is opened in append
mode, so the file position can be tracked and seek and tell will work correctly. If the file is
a stream that can't be randomly accessed, you don't need to override
this method,
|
_read(self, size)(subclass override) Read data from the stream. ReturnNone or raise EOFError to indicate EOF.
|
_write(self, data)(subclass override) Write data into the stream.
|
Class Variable Details |
---|
MAX_REQUEST_SIZE
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Sun Dec 4 11:16:47 2005 | http://epydoc.sf.net |