BufferedFile is a file-like object reading underlying file in chunks.
def google.appengine.api.files.file.BufferedFile.__init__ |
( |
|
self, |
|
|
|
filename, |
|
|
|
buffer_size = _DEFAULT_BUFFER_SIZE |
|
) |
| |
Constructor.
Args:
filename: the name of the file to read as string.
buffer_size: buffer read size to use as int.
def google.appengine.api.files.file.BufferedFile.read |
( |
|
self, |
|
|
|
size = None |
|
) |
| |
Read data from RAW file.
Args:
size: Number of bytes to read as integer. Actual number of bytes
read is always equal to size unless end if file was reached.
Returns:
A string with data read.
def google.appengine.api.files.file.BufferedFile.readline |
( |
|
self, |
|
|
|
size = -1 |
|
) |
| |
Read one line delimited by '\n' from the file.
A trailing newline character is kept in the string. It may be absent when a
file ends with an incomplete line. If the size argument is non-negative,
it specifies the maximum string size (counting the newline) to return. An
empty string is returned only when EOF is encountered immediately.
Args:
size: Maximum number of bytes to read. If not specified, readline stops
only on '\n' or EOF.
Returns:
The data read as a string.
def google.appengine.api.files.file.BufferedFile.seek |
( |
|
self, |
|
|
|
offset, |
|
|
|
whence = os.SEEK_SET |
|
) |
| |
Set the file's current position.
Args:
offset: seek offset as number.
whence: seek mode. Supported modes are os.SEEK_SET (absolute seek),
os.SEEK_CUR (seek relative to the current position), and os.SEEK_END
(seek relative to the end, offset should be negative).
def google.appengine.api.files.file.BufferedFile.tell |
( |
|
self | ) |
|
Return file's current position.
The documentation for this class was generated from the following file:
- code/googleappengine-read-only/python/google/appengine/api/files/file.py