Gio.FileIOStream¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gio.FileIOStream(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
GFileIOStream
provides I/O streams that both read and write to the same file handle.GFileIOStream
implements [iface`Gio`.Seekable], which allows the I/O stream to jump to arbitrary positions in the file and to truncate the file, provided the filesystem of the file supports these operations.To find the position of a file I/O stream, use [method`Gio`.Seekable.tell].
To find out if a file I/O stream supports seeking, use [method`Gio`.Seekable.can_seek]. To position a file I/O stream, use [method`Gio`.Seekable.seek]. To find out if a file I/O stream supports truncating, use [method`Gio`.Seekable.can_truncate]. To truncate a file I/O stream, use [method`Gio`.Seekable.truncate].
The default implementation of all the
GFileIOStream
operations and the implementation of [iface`Gio`.Seekable] just call into the same operations on the output stream.New in version 2.22.
- get_etag()[source]¶
-
Gets the entity tag for the file when it has been written. This must be called after the stream has been written and closed, as the etag can change while writing.
New in version 2.22.
- query_info(attributes, cancellable)[source]¶
- Parameters:
attributes (
str
) – a file attribute query string.cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignore.
- Raises:
- Returns:
a
Gio.FileInfo
for the self, orNone
on error.- Return type:
Queries a file io stream for the given attributes. This function blocks while querying the stream. For the asynchronous version of this function, see
Gio.FileIOStream.query_info_async
(). While the stream is blocked, the stream will set the pending flag internally, and any other operations on the stream will fail withGio.IOErrorEnum.PENDING
.Can fail if the stream was already closed (with error being set to
Gio.IOErrorEnum.CLOSED
), the stream has pending operations (with error being set toGio.IOErrorEnum.PENDING
), or if querying info is not supported for the stream’s interface (with error being set toGio.IOErrorEnum.NOT_SUPPORTED
). I all cases of failure,None
will be returned.If cancellable is not
None
, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the errorGio.IOErrorEnum.CANCELLED
will be set, andNone
will be returned.New in version 2.22.
- query_info_async(attributes, io_priority, cancellable, callback, *user_data)[source]¶
- Parameters:
attributes (
str
) – a file attribute query string.io_priority (
int
) – the I/O priority of the requestcancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignore.callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – the data to pass to callback function
Asynchronously queries the self for a
Gio.FileInfo
. When completed, callback will be called with aGio.AsyncResult
which can be used to finish the operation withGio.FileIOStream.query_info_finish
().For the synchronous version of this function, see
Gio.FileIOStream.query_info
().New in version 2.22.
- query_info_finish(result)[source]¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
.- Raises:
- Returns:
A
Gio.FileInfo
for the finished query.- Return type:
Finalizes the asynchronous query started by
Gio.FileIOStream.query_info_async
().New in version 2.22.
- do_get_etag() virtual¶
-
Gets the entity tag for the file when it has been written. This must be called after the stream has been written and closed, as the etag can change while writing.
New in version 2.22.
- do_query_info(attributes, cancellable) virtual¶
- Parameters:
attributes (
str
) – a file attribute query string.cancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignore.
- Returns:
a
Gio.FileInfo
for the stream, orNone
on error.- Return type:
Queries a file io stream for the given attributes. This function blocks while querying the stream. For the asynchronous version of this function, see
Gio.FileIOStream.query_info_async
(). While the stream is blocked, the stream will set the pending flag internally, and any other operations on the stream will fail withGio.IOErrorEnum.PENDING
.Can fail if the stream was already closed (with error being set to
Gio.IOErrorEnum.CLOSED
), the stream has pending operations (with error being set toGio.IOErrorEnum.PENDING
), or if querying info is not supported for the stream’s interface (with error being set toGio.IOErrorEnum.NOT_SUPPORTED
). I all cases of failure,None
will be returned.If cancellable is not
None
, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the errorGio.IOErrorEnum.CANCELLED
will be set, andNone
will be returned.New in version 2.22.
- do_query_info_async(attributes, io_priority, cancellable, callback, *user_data) virtual¶
- Parameters:
attributes (
str
) – a file attribute query string.io_priority (
int
) – the I/O priority of the requestcancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object,None
to ignore.callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when the request is satisfieduser_data (
object
orNone
) – the data to pass to callback function
Asynchronously queries the stream for a
Gio.FileInfo
. When completed, callback will be called with aGio.AsyncResult
which can be used to finish the operation withGio.FileIOStream.query_info_finish
().For the synchronous version of this function, see
Gio.FileIOStream.query_info
().New in version 2.22.
- do_query_info_finish(result) virtual¶
- Parameters:
result (
Gio.AsyncResult
) – aGio.AsyncResult
.- Returns:
A
Gio.FileInfo
for the finished query.- Return type:
Finalizes the asynchronous query started by
Gio.FileIOStream.query_info_async
().New in version 2.22.
- do_seek(offset, type, cancellable) virtual¶
- Parameters:
offset (
int
) –type (
GLib.SeekType
) –cancellable (
Gio.Cancellable
orNone
) –
- Return type:
- do_truncate_fn(size, cancellable) virtual¶
- Parameters:
size (
int
) –cancellable (
Gio.Cancellable
orNone
) –
- Return type: