:right-sidebar: True FileIOStream =================================================================== .. currentmodule:: gi.repository.Gio .. versionadded:: 2.22 .. class:: FileIOStream(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gio.IOStream`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gio.Seekable` :Constructors: :: FileIOStream(**properties) Methods ------- .. rst-class:: interim-class .. class:: FileIOStream :no-index: .. method:: get_etag() -> str | None 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. .. versionadded:: 2.22 .. method:: query_info(attributes: str, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> ~gi.repository.Gio.FileInfo Queries a file io stream for the given ``attributes``. This function blocks while querying the stream. For the asynchronous version of this function, see :func:`~gi.repository.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 with :const:`~gi.repository.Gio.IOErrorEnum.PENDING`. Can fail if the stream was already closed (with ``error`` being set to :const:`~gi.repository.Gio.IOErrorEnum.CLOSED`), the stream has pending operations (with ``error`` being set to :const:`~gi.repository.Gio.IOErrorEnum.PENDING`), or if querying info is not supported for the stream's interface (with ``error`` being set to :const:`~gi.repository.Gio.IOErrorEnum.NOT_SUPPORTED`). I all cases of failure, :const:`None` will be returned. If ``cancellable`` is not :const:`None`, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED` will be set, and :const:`None` will be returned. .. versionadded:: 2.22 :param attributes: a file attribute query string. :param cancellable: optional :obj:`~gi.repository.Gio.Cancellable` object, :const:`None` to ignore. .. method:: query_info_async(attributes: str, io_priority: int, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[...], None] | None = None, *user_data: ~typing.Any) -> None Asynchronously queries the ``stream`` for a :obj:`~gi.repository.Gio.FileInfo`. When completed, ``callback`` will be called with a :obj:`~gi.repository.Gio.AsyncResult` which can be used to finish the operation with :func:`~gi.repository.Gio.FileIOStream.query_info_finish`. For the synchronous version of this function, see :func:`~gi.repository.Gio.FileIOStream.query_info`. .. versionadded:: 2.22 :param attributes: a file attribute query string. :param io_priority: the `I/O priority `_ of the request :param cancellable: optional :obj:`~gi.repository.Gio.Cancellable` object, :const:`None` to ignore. :param callback: a :obj:`~gi.repository.Gio.AsyncReadyCallback` to call when the request is satisfied :param user_data: the data to pass to callback function .. method:: query_info_finish(result: ~gi.repository.Gio.AsyncResult) -> ~gi.repository.Gio.FileInfo Finalizes the asynchronous query started by :func:`~gi.repository.Gio.FileIOStream.query_info_async`. .. versionadded:: 2.22 :param result: a :obj:`~gi.repository.Gio.AsyncResult`. Virtual Methods --------------- .. rst-class:: interim-class .. class:: FileIOStream :no-index: .. method:: do_can_seek() -> bool .. method:: do_can_truncate() -> bool .. method:: do_get_etag() -> str | None 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. .. versionadded:: 2.22 .. method:: do_query_info(attributes: str, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> ~gi.repository.Gio.FileInfo Queries a file io stream for the given ``attributes``. This function blocks while querying the stream. For the asynchronous version of this function, see :func:`~gi.repository.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 with :const:`~gi.repository.Gio.IOErrorEnum.PENDING`. Can fail if the stream was already closed (with ``error`` being set to :const:`~gi.repository.Gio.IOErrorEnum.CLOSED`), the stream has pending operations (with ``error`` being set to :const:`~gi.repository.Gio.IOErrorEnum.PENDING`), or if querying info is not supported for the stream's interface (with ``error`` being set to :const:`~gi.repository.Gio.IOErrorEnum.NOT_SUPPORTED`). I all cases of failure, :const:`None` will be returned. If ``cancellable`` is not :const:`None`, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error :const:`~gi.repository.Gio.IOErrorEnum.CANCELLED` will be set, and :const:`None` will be returned. .. versionadded:: 2.22 :param attributes: a file attribute query string. :param cancellable: optional :obj:`~gi.repository.Gio.Cancellable` object, :const:`None` to ignore. .. method:: do_query_info_async(attributes: str, io_priority: int, cancellable: ~gi.repository.Gio.Cancellable | None = None, callback: ~typing.Callable[[...], None] | None = None, *user_data: ~typing.Any) -> None Asynchronously queries the ``stream`` for a :obj:`~gi.repository.Gio.FileInfo`. When completed, ``callback`` will be called with a :obj:`~gi.repository.Gio.AsyncResult` which can be used to finish the operation with :func:`~gi.repository.Gio.FileIOStream.query_info_finish`. For the synchronous version of this function, see :func:`~gi.repository.Gio.FileIOStream.query_info`. .. versionadded:: 2.22 :param attributes: a file attribute query string. :param io_priority: the `I/O priority `_ of the request :param cancellable: optional :obj:`~gi.repository.Gio.Cancellable` object, :const:`None` to ignore. :param callback: a :obj:`~gi.repository.Gio.AsyncReadyCallback` to call when the request is satisfied :param user_data: the data to pass to callback function .. method:: do_query_info_finish(result: ~gi.repository.Gio.AsyncResult) -> ~gi.repository.Gio.FileInfo Finalizes the asynchronous query started by :func:`~gi.repository.Gio.FileIOStream.query_info_async`. .. versionadded:: 2.22 :param result: a :obj:`~gi.repository.Gio.AsyncResult`. .. method:: do_seek(offset: int, type: ~gi.repository.GLib.SeekType, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> bool :param offset: :param type: :param cancellable: .. method:: do_tell() -> int .. method:: do_truncate_fn(size: int, cancellable: ~gi.repository.Gio.Cancellable | None = None) -> bool :param size: :param cancellable: Fields ------ .. rst-class:: interim-class .. class:: FileIOStream :no-index: .. attribute:: parent_instance .. attribute:: priv