gio.SeekableStream seeking interface.Synopsisgio.Seekablegobject.GInterfacetellcan_seekseekoffsettype0cancellableNonecan_truncatetruncateoffsetcancellableNoneAncestry+-- gobject.GInterface
+-- gio.Seekable
Known Implementationgio.Seekable is implemented by
gio.FileOutputStream,
gio.MemoryInputStream,
gio.FileInputStream and
gio.MemoryOutputStream.
Descriptiongio.Seekable
is implemented by streams (implementations of
gio.InputStream or
gio.OutputStream)
that support seeking.
Methodsgio.Seekable.telltellReturns :
the offset from the beginning of the buffer
Tells the current position within the stream.
gio.Seekable.can_seekcan_seekReturns :True if this
gio.Seekable can be seeked with
the seek() method, False
if not.
The can_seek() method checks if the
seek()
can be used on this gio.Seekable.
gio.Seekable.seekseekoffsettype0cancellableNoneoffset :the offset that is added to the position determined by the type parameter.
type :0=current position, 1=start of the file, 2=end of the file.cancellable :a gio.Cancellable
or None.Returns :True on successful seek,
False otherwise.
Seeks in the stream by the given offset, modified by type.
If cancellable is not None, then the
operation can be cancelled by triggering the cancellable object from another thread.
gio.Seekable.can_truncatecan_truncateReturns :True if this
gio.Seekable can be truncated with
the truncate() method, False
if not.
The can_truncate() method checks if the
truncate()
can be used on this gio.Seekable.
gio.Seekable.truncatetruncateoffsetcancellableNoneoffset :the offset at which the stream should be truncated
cancellable :a gio.Cancellable
or None.Returns :True if successful,
False otherwise.
Truncates a stream with a given offset.
If cancellable is not None, then the
operation can be cancelled by triggering the cancellable object from another thread.
If an operation was partially finished when the operation was cancelled the
partial result will be returned, without an error.