objects seek
objects seek

Provides an interface for file input/output. FileOpen() returns an object of this type.
This property should be used only with an actual file. If the File object was created from a handle to a pipe, it may return the amount of data currently available in the pipe`s internal buffer, but this behaviour is not guaranteed.
This property should be used only with an actual file. If the File object was created from a handle to a non-seeking device such as a console buffer or pipe, the returned value may not be meaningful, as such devices do not logically have an .
Although the file is closed automatically when the object is freed, it is recommended to close the file as soon as possible.
Retrieves or sets the text encoding used by this file object.
File objects internally buffer reads or writes. If data has been written into the object`s internal buffer, it is committed to disk before the handle is returned. If the buffer contains data read from file, it is discarded and the actual file pointer is reset to the logical position indicated by File.Pos.
The mode argument specifies the access mode in which the file is to be opened. The permitted values and their meanings are: Value Meaning Open for reading only. Invoking any of the write methods of the resulting object will cause an IOException to be thrown. Open for reading and writing. If the file does not already exist then an attempt will be made to create it. Open for reading and writing, as with , and also require that every update to the files content be written synchronously to the underlying storage device. The and modes work much like the force(boolean) method of the FileChannel class, passing arguments of true and false, respectively, except that they always apply to every I/O operation and are therefore often more efficient. If the file resides on a local storage device then when an invocation of a method of this class returns it is guaranteed that all changes made to the file by that invocation will have been written to that device. This is useful for ensuring that critical information is not lost in the event of a system crash. If the file does not reside on a local device then no such guarantee is made.
The position of the returned channel will always be equal to this objects length via this object will change the length seen via the file channel, and vice versa.
Instances of the class LargeObject are used to handle all the requests concerning a PostgreSQL large object. These objects embed and hide all the recurring variables (object OID and connection), in the same way Connection instances do, thus only keeping significant parameters in function calls. The LargeObject instance keeps a reference to the Connection object used for its creation, sending requests through with its parameters. Any modification other than dereferencing the Connection object will thus affect the LargeObject instance. Dereferencing the initial Connection object is not a problem since Python won’t deallocate it before the LargeObject instance dereferences it. All functions return a generic error message on error. The exact error message is provided by the object`s error attribute.
See also the PostgreSQL documentation for more information about the large object interface.
IOError – already opened object, or open error
This method opens a large object for reading/writing, in a similar manner as the Unix open() function does for files. The mode value can be obtained by OR-ing the constants defined in the pg module (INV_READ, INV_WRITE).
IOError – object is not opened, or close error
This method closes a previously opened large object, in a similar manner as the Unix close() function.
TypeError – invalid connection, invalid object, bad parameter type, or too many parameters
IOError – object is not opened, or read error
This function allows reading data from a large object, starting at the current position.
IOError – object is not opened, or write error
This function allows writing data to a large object, starting at the current position.
TypeError – invalid connection or invalid object, bad parameter type, or too many parameters
IOError – object is not opened, or seek error
This method updates the position offset in the large object. The valid values for the whence parameter are defined as constants in the pg module (SEEK_SET, SEEK_CUR, SEEK_END).
IOError – object is not opened, or seek error
This method returns the current position offset in the large object.
IOError – object is not closed, or unlink error
This methods unlinks (deletes) the PostgreSQL large object.
IOError – object is not opened, or seek/tell error
This (composite) method returns the size of a large object. It was implemented because this function is very useful for a web interfaced database. Currently, the large object needs to be opened first.
Export a large object to a file
TypeError – invalid connection or invalid object, bad parameter type, or too many parameters
IOError – object is not closed, or export error
This methods allows saving the content of a large object to a file in a very simple way. The file is created on the host running the PyGreSQL interface, not on the server host.
LargeObject objects define a read-only set of attributes exposing some information about it. These attributes are:
the OID associated with the large object (int)
the Connection object associated with the large object
In multi-threaded environments, LargeObject.error may be modified by another thread using the same Connection. Remember these objects are shared, not duplicated. You should provide some locking if you want to use this information in a program in which it`s shared between multiple threads. The LargeObject.oid attribute is very interesting, because it allows you to reuse the OID later, creating the LargeObject object with a Connection.getlo() method call.
We offer objects seek
objects seek, objects, seek,
