| [ Web Proxy ] |
| Viewing: https://docs.python.org/2.3/api/fileObjects.html | [Back] [Original] |
Python's built-in file objects are implemented entirely on the FILE* support from the C standard library. This is an implementation detail and may change in future releases of Python.
types.FileType.
| int PyFile_Check( | PyObject *p) |
| int PyFile_CheckExact( | PyObject *p) |
| PyObject* PyFile_FromString( | char *filename, char *mode) |
| PyObject* PyFile_FromFile( | FILE *fp, char *name, char *mode, int (*close)(FILE*)) |
| FILE* PyFile_AsFile( | PyFileObject *p) |
| PyObject* PyFile_GetLine( | PyObject *p, int n) |
p.readline([n]), this
function reads one line from the object p. p may be a
file object or any object with a readline() method. If
n is 0, exactly one line is read, regardless of the
length of the line. If n is greater than 0, no more
than n bytes will be read from the file; a partial line can be
returned. In both cases, an empty string is returned if the end of
the file is reached immediately. If n is less than 0,
however, one line is read regardless of length, but
EOFError is raised if the end of the file is reached
immediately.
| PyObject* PyFile_Name( | PyObject *p) |
| void PyFile_SetBufSize( | PyFileObject *p, int n) |
| int PyFile_Encoding( | PyFileObject *p, char *enc) |
| int PyFile_SoftSpace( | PyObject *p, int newflag) |
0 as the previous
value if the attribute either does not exist or if there were errors
in retrieving it. There is no way to detect errors from this
function, but doing so should not be needed.
| int PyFile_WriteObject( | PyObject *obj, PyFileObject *p, int flags) |
0 on success or -1 on
failure; the appropriate exception will be set.
| int PyFile_WriteString( | const char *s, PyFileObject *p) |
0 on
success or -1 on failure; the appropriate exception will be
set.
See About this document... for information on suggesting changes.
| Web Proxy Viewer | New URL | Original Page |