FileInputStream

class FileInputStream(**properties: Any)

Superclasses: InputStream, Object

Implemented Interfaces: 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 tell. To find out if a file input stream supports seeking, use can_seek. To position a file input stream, use seek.

Methods

class FileInputStream
query_info(attributes: str, cancellable: Cancellable | None = None) FileInfo

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 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 PENDING.

Parameters:
  • attributes – a file attribute query string.

  • cancellable – optional Cancellable object, None to ignore.

query_info_async(attributes: str, io_priority: int, cancellable: Cancellable | None = None, callback: Callable[[...], None] | None = None, *user_data: Any) None

Queries the stream information asynchronously. When the operation is finished callback will be called. You can then call query_info_finish() to get the result of the operation.

For the synchronous version of this function, see 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 CANCELLED will be set

Parameters:
  • attributes – a file attribute query string.

  • io_priority – the [I/O priority][io-priority] of the request

  • cancellable – optional Cancellable object, None to ignore.

  • callback – a AsyncReadyCallback to call when the request is satisfied

  • user_data – the data to pass to callback function

query_info_finish(result: AsyncResult) FileInfo

Finishes an asynchronous info query operation.

Parameters:

result – a AsyncResult.

Virtual Methods

class FileInputStream
do_can_seek() bool
do_query_info(attributes: str, cancellable: Cancellable | None = None) FileInfo

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 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 PENDING.

Parameters:
  • attributes – a file attribute query string.

  • cancellable – optional Cancellable object, None to ignore.

do_query_info_async(attributes: str, io_priority: int, cancellable: Cancellable | None = None, callback: Callable[[...], None] | None = None, *user_data: Any) None

Queries the stream information asynchronously. When the operation is finished callback will be called. You can then call query_info_finish() to get the result of the operation.

For the synchronous version of this function, see 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 CANCELLED will be set

Parameters:
  • attributes – a file attribute query string.

  • io_priority – the [I/O priority][io-priority] of the request

  • cancellable – optional Cancellable object, None to ignore.

  • callback – a AsyncReadyCallback to call when the request is satisfied

  • user_data – the data to pass to callback function

do_query_info_finish(result: AsyncResult) FileInfo

Finishes an asynchronous info query operation.

Parameters:

result – a AsyncResult.

do_seek(offset: int, type: SeekType, cancellable: Cancellable | None = None) bool
Parameters:
  • offset

  • type

  • cancellable

do_tell() int

Fields

class FileInputStream
parent_instance
priv