Basics
Guides
API Reference
Basics
Guides
API Reference
[23:7] extends: object
GFileIOStream provides I/O streams that both read and write to the same
file handle. GFileIOStream implements [iface@Gio.Seekable], which allows
the I/O 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 I/O stream, use [method@Gio.Seekable.tell]. To find
out if a file I/O stream supports seeking, use
[method@Gio.Seekable.can_seek]. To position a file I/O stream, use
[method@Gio.Seekable.seek]. To find out if a file I/O stream supports
truncating, use [method@Gio.Seekable.can_truncate]. To truncate a file I/O
stream, use [method@Gio.Seekable.truncate]. The default implementation of all
the GFileIOStream operations and the implementation of [iface@Gio.Seekable]
just call into the same operations on the output stream.
FileIOStream (Handle = null)
Creates a new
FileIOStreamby wrapping a native handle or another wrapper.
Handle is the native handle or another wrapper whose handle to adopt.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asIOStream ()
Wraps this handle as
IOStream.
A IOStream object.asSeekable ()
Wraps this handle as
Seekable.
A Seekable object.get_etag ()
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 (string attributes, object cancellable)
Queries a file io stream for the given @attributes. This function blocks while querying the stream. For the asynchronous version of this function, see g_file_io_stream_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 %G_IO_ERROR_PENDING. Can fail if the stream was already closed (with @error being set to %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being set to %G_IO_ERROR_PENDING), or if querying info is not supported for the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I all cases of failure, %NULL will be returned. If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will be returned.
attributes is a file attribute query string..cancellable is optional #GCancellable object, %NULL to ignore..query_info_finish (object result)
Finalizes the asynchronous query started by g_file_io_stream_query_info_async().
result is a #GAsyncResult..
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.