Gio.FileOutputStream¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | Gio.OutputStream (29), GObject.Object (37), Gio.Seekable (5) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| get_etag() | |
| query_info(attributes, cancellable) | |
| query_info_async(attributes, io_priority, cancellable, callback, *user_data) | |
| query_info_finish(result) | 
Virtual Methods¶
| Inherited: | Gio.OutputStream (15), GObject.Object (7), Gio.Seekable (5) | 
|---|
| do_can_seek() | |
| do_can_truncate() | |
| do_get_etag() | |
| do_query_info(attributes, cancellable) | |
| do_query_info_async(attributes, io_priority, cancellable, callback, *user_data) | |
| do_query_info_finish(result) | |
| do_seek(offset, type, cancellable) | |
| do_tell() | |
| do_truncate_fn(size, cancellable) | 
Properties¶
None
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Fields¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| parent_instance | Gio.OutputStream | r | 
Class Details¶
- 
class Gio.FileOutputStream(**kwargs)¶
- Bases: - Gio.OutputStream,- Gio.Seekable- Abstract: - No - Structure: - Gio.FileOutputStreamClass- Gio.FileOutputStreamprovides output streams that write their content to a file.- Gio.FileOutputStreamimplements- Gio.Seekable, which allows the output 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 output stream, use - Gio.Seekable.tell(). To find out if a file output stream supports seeking, use- Gio.Seekable.can_seek().To position a file output stream, use- Gio.Seekable.seek(). To find out if a file output stream supports truncating, use- Gio.Seekable.can_truncate(). To truncate a file output stream, use- Gio.Seekable.truncate().- 
get_etag()[source]¶
- Returns: - the entity tag for the stream. - Return type: - str- 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. 
 - 
query_info(attributes, cancellable)[source]¶
- Parameters: - attributes (str) – a file attribute query string.
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignore.
 - Raises: - Returns: - a - Gio.FileInfofor the self, or- Noneon error.- Return type: - Queries a file output stream for the given attributes. This function blocks while querying the stream. For the asynchronous version of this function, see - Gio.FileOutputStream.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 with- Gio.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 to- Gio.IOErrorEnum.PENDING), or if querying info is not supported for the stream’s interface (with error being set to- Gio.IOErrorEnum.NOT_SUPPORTED). In all cases of failure,- Nonewill 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 error- Gio.IOErrorEnum.CANCELLEDwill be set, and- Nonewill be returned.
- attributes (
 - 
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 request
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignore.
- callback (Gio.AsyncReadyCallbackorNone) – callback to call when the request is satisfied
- user_data (objectorNone) – the data to pass to callback function
 - Asynchronously queries the self for a - Gio.FileInfo. When completed, callback will be called with a- Gio.AsyncResultwhich can be used to finish the operation with- Gio.FileOutputStream.query_info_finish().- For the synchronous version of this function, see - Gio.FileOutputStream.query_info().
- attributes (
 - 
query_info_finish(result)[source]¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult.- Raises: - GLib.Error- Returns: - A - Gio.FileInfofor the finished query.- Return type: - Gio.FileInfo- Finalizes the asynchronous query started by - Gio.FileOutputStream.query_info_async().
 - 
do_get_etag() virtual¶
- Returns: - the entity tag for the stream. - Return type: - str- 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. 
 - 
do_query_info(attributes, cancellable) virtual¶
- Parameters: - attributes (str) – a file attribute query string.
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignore.
 - Returns: - a - Gio.FileInfofor the stream, or- Noneon error.- Return type: - Queries a file output stream for the given attributes. This function blocks while querying the stream. For the asynchronous version of this function, see - Gio.FileOutputStream.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 with- Gio.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 to- Gio.IOErrorEnum.PENDING), or if querying info is not supported for the stream’s interface (with error being set to- Gio.IOErrorEnum.NOT_SUPPORTED). In all cases of failure,- Nonewill 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 error- Gio.IOErrorEnum.CANCELLEDwill be set, and- Nonewill be returned.
- attributes (
 - 
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 request
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignore.
- callback (Gio.AsyncReadyCallbackorNone) – callback to call when the request is satisfied
- user_data (objectorNone) – the data to pass to callback function
 - Asynchronously queries the stream for a - Gio.FileInfo. When completed, callback will be called with a- Gio.AsyncResultwhich can be used to finish the operation with- Gio.FileOutputStream.query_info_finish().- For the synchronous version of this function, see - Gio.FileOutputStream.query_info().
- attributes (
 - 
do_query_info_finish(result) virtual¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult.- Returns: - A - Gio.FileInfofor the finished query.- Return type: - Gio.FileInfo- Finalizes the asynchronous query started by - Gio.FileOutputStream.query_info_async().
 - 
do_seek(offset, type, cancellable) virtual¶
- Parameters: - offset (int) –
- type (GLib.SeekType) –
- cancellable (Gio.CancellableorNone) –
 - Return type: 
- offset (
 - 
do_truncate_fn(size, cancellable) virtual¶
- Parameters: - size (int) –
- cancellable (Gio.CancellableorNone) –
 - Return type: 
- size (
 
-