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. |
Change the mode (permissions) of this file. | |
Change the owner ( uid ) and group (gid ) 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. | |
list(str) |
Read a set of blocks from the file by (offset, length). |
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. |
Change the size of this file. | |
Set the access and modified times of this file. | |
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) . |
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 |
FLAG_APPEND = 4 |
int |
FLAG_BINARY = 16 |
int |
FLAG_BUFFERED = 32 |
int |
FLAG_LINE_BUFFERED = 64 |
int |
FLAG_READ = 1 |
int |
FLAG_UNIVERSAL_NEWLINE = 128 |
int |
FLAG_WRITE = 2 |
int |
SEEK_CUR = 1 |
int |
SEEK_END = 2 |
int |
SEEK_SET = 0 |
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.
|
chmod(self, mode)Change the mode (permissions) of this file. The permissions are unix-style and identical to those used by python'sos.chmod function.
|
chown(self, uid, gid)Change the owner (uid ) and group (gid ) of
this 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 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
future read method. Once data has been read,
it's removed from the buffer. The data may be read in a random order
(using seek ); chunks of the buffer that haven't
been read will continue to be buffered.
|
readv(self, chunks)Read a set of blocks from the file by (offset, length). This is more efficient than doing a series ofseek and read calls, since the prefetch machinery
is used to retrieve all the requested blocks at once.
|
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.
|
truncate(self, size)Change the size of this file. This usually extends or shrinks the size of the file, just like thetruncate() method on
python file objects.
|
utime(self, times)Set the access and modified times of this file. Iftimes 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 Variable Details |
---|
MAX_REQUEST_SIZE
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Mon Jan 21 19:06:10 2008 | http://epydoc.sf.net |