FileInputStream#
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
-
- do_query_info(self, attributes: str, cancellable: Cancellable | None = None) FileInfo #
- Parameters:
attributes
cancellable
- do_query_info_async(self, attributes: str, io_priority: int, cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None #
- Parameters:
attributes
io_priority
cancellable
callback
user_data
- do_query_info_finish(self, result: AsyncResult) FileInfo #
- Parameters:
result
- do_seek(self, offset: int, type: SeekType, cancellable: Cancellable | None = None) bool #
- Parameters:
offset
type
cancellable
- 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, seequery_info_async()
. While the stream is blocked, the stream will set the pending flag internally, and any other operations on the stream will fail withPENDING
.- 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[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None #
Queries the stream information asynchronously. When the operation is finished
callback
will be called. You can then callquery_info_finish()
to get the result of the operation.For the synchronous version of this function, see
query_info()
.If
cancellable
is notNone
, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the errorCANCELLED
will be set- Parameters:
attributes – a file attribute query string.
io_priority – the I/O priority of the request
cancellable – optional
Cancellable
object,None
to ignore.callback – a
AsyncReadyCallback
to call when the request is satisfieduser_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_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, seequery_info_async()
. While the stream is blocked, the stream will set the pending flag internally, and any other operations on the stream will fail withPENDING
.- 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[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None #
Queries the stream information asynchronously. When the operation is finished
callback
will be called. You can then callquery_info_finish()
to get the result of the operation.For the synchronous version of this function, see
query_info()
.If
cancellable
is notNone
, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the errorCANCELLED
will be set- Parameters:
attributes – a file attribute query string.
io_priority – the I/O priority of the request
cancellable – optional
Cancellable
object,None
to ignore.callback – a
AsyncReadyCallback
to call when the request is satisfieduser_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
.