Home | Trees | Index | Help |
---|
Package paramiko :: Class BufferedFile |
|
object
--+
|
BufferedFile
SFTPFile
Method Summary | |
---|---|
__init__(self)
| |
__del__(self)
| |
iterator |
Returns an iterator that can be used to iterate over the lines in this file. |
Close the 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. |
Set the file's current position, like stdio's fseek . | |
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 |
SEEK_CUR = 1 |
int |
SEEK_END = 2 |
int |
SEEK_SET = 0 |
Method Details |
---|
__iter__(self)Returns an iterator that can be used to iterate over the lines in this file. This iterator happens to return the file itself, since a file is its own iterator.
|
close(self)Close the file. Future read and write operations will fail. |
flush(self)Write out any data in the write buffer. This may do nothing if write buffering is not turned on. |
next(self)Returns the next line from the input, or raisesStopIteration when EOF is hit. Unlike python file objects,
it's okay to mix calls to next and readline .
|
read(self, size=None)Read at mostsize bytes from the file (less if we hit
the end of the file first). If the size argument is
negative or omitted, read all the remaining data in the file.
|
readline(self, size=None)Read one entire line from the file. A trailing newline character is kept in the string (but may be absent when a file ends with an incomplete line). If the size argument is present and non-negative, it is a maximum byte count (including the trailing newline) and an incomplete line may be returned. An empty string is returned only when EOF is encountered immediately.
|
readlines(self, sizehint=None)Read all remaining lines usingreadline and return them as a list. If
the optional sizehint argument is present, instead of
reading up to EOF, whole lines totalling approximately sizehint bytes
(possibly after rounding up to an internal buffer size) are read.
|
seek(self, offset, whence=0)Set the file's current position, like stdio'sfseek .
Not all file objects support seeking.
|
tell(self)Return the file's current position. This may not be accurate or useful if the underlying file doesn't support random access, or was opened in append mode.
|
write(self, data)Write data to the file. If write buffering is on (bufsize was specified and non-zero), some or all of the
data may not actually be written yet. (Use flush or close to force buffered data to be
written out.)
|
writelines(self, sequence)Write a sequence of strings to the file. The sequence can be any iterable object producing strings, typically a list of strings. (The name is intended to matchreadlines ; writelines does
not add line separators.)
|
xreadlines(self)Identical toiter(f) . This is a deprecated file
interface that predates python iterator support.
|
Class Variable Details |
---|
SEEK_CUR
|
SEEK_END
|
SEEK_SET
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Sun Dec 4 11:16:47 2005 | http://epydoc.sf.net |