Gio.FileInputStream¶
class — extends InputStream, Seekable
GFileInputStream provides input streams that take their
content from a file.
GFileInputStream implements Seekable, which allows the input
stream to jump to arbitrary positions in the file, provided the
filesystem of the file allows it. To find the position of a file
input stream, use Seekable.tell. To find out if a file input
stream supports seeking, use Seekable.can_seek.
To position a file input stream, use Seekable.seek.
Methods¶
query_info¶
Queries a file input stream the given attributes. This function blocks
while querying the stream. For the asynchronous (non-blocking) version
of this function, see FileInputStream.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 IOErrorEnum.PENDING.
Parameters:
attributes— a file attribute query string.cancellable— optionalCancellableobject,Noneto ignore.
query_info_async¶
def query_info_async(self, attributes: str, io_priority: int, cancellable: Cancellable | None = ..., callback: Callable[[FileInputStream | None, AsyncResult], None] | None = ...) -> None
Queries the stream information asynchronously.
When the operation is finished callback will be called.
You can then call FileInputStream.query_info_finish
to get the result of the operation.
For the synchronous version of this function,
see FileInputStream.query_info.
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 IOErrorEnum.CANCELLED will be set
Parameters:
attributes— a file attribute query string.io_priority— the I/O priority of the requestcancellable— optionalCancellableobject,Noneto ignore.callback— aGAsyncReadyCallbackto call when the request is satisfied
query_info_finish¶
Finishes an asynchronous info query operation.
Parameters:
result— aAsyncResult.
Virtual methods¶
do_can_seek¶
do_query_info¶
Queries a file input stream the given attributes. This function blocks
while querying the stream. For the asynchronous (non-blocking) version
of this function, see FileInputStream.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 IOErrorEnum.PENDING.
Parameters:
attributes— a file attribute query string.cancellable— optionalCancellableobject,Noneto ignore.
do_query_info_async¶
def do_query_info_async(self, attributes: str, io_priority: int, cancellable: Cancellable | None = ..., callback: Callable[[FileInputStream | None, AsyncResult], None] | None = ...) -> None
Queries the stream information asynchronously.
When the operation is finished callback will be called.
You can then call FileInputStream.query_info_finish
to get the result of the operation.
For the synchronous version of this function,
see FileInputStream.query_info.
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 IOErrorEnum.CANCELLED will be set
Parameters:
attributes— a file attribute query string.io_priority— the I/O priority of the requestcancellable— optionalCancellableobject,Noneto ignore.callback— aGAsyncReadyCallbackto call when the request is satisfied
do_query_info_finish¶
Finishes an asynchronous info query operation.
Parameters:
result— aAsyncResult.
do_seek¶
def do_seek(self, offset: int, type: GLib.SeekType | int, cancellable: Cancellable | None = ...) -> bool