GFileOutputStream provides output streams that write their content to a file.
GFileOutputStream implements Gseekable.Gseekable, which allows the output 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 output stream, use g_seekable_tell. To find out if a file output stream supports seeking, use g_seekable_can_seek.To position a file output stream, use g_seekable_seek. To find out if a file output stream supports truncating, use g_seekable_can_truncate. To truncate a file output stream, use g_seekable_truncate.
type Gasync_Ready_Callback is access procedure
(Source_Object : access Glib.Object.GObject_Record'Class;
Res : Glib.G_Async_Result);
Type definition for a function that will be called back when an asynchronous operation within GIO has been completed. Gasync_Ready_Callback callbacks from Gtask.Gtask are guaranteed to be invoked in a later iteration of the thread-default main context (see [methodGlib.MainContext.push_thread_default]) where the Gtask.Gtask was created. All other users of Gasync_Ready_Callback must likewise call it asynchronously in a later iteration of the main context. The asynchronous operation is guaranteed to have held a reference to Source_Object from the time when the *_async function was called, until after this callback returns.
the object the asynchronous operation was started with.
a Glib.G_Async_Result.
function Get_Etag
(Self : not null access Gfile_Output_Stream_Record) return UTF8_String
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.
the entity tag for the stream.
function Get_Type return Glib.GType
type Gfile_Output_Stream is access all Gfile_Output_Stream_Record'Class;
type Gfile_Output_Stream_Record is new Goutput_Stream_Record with null record;
function Query_Info
(Self : not null access Gfile_Output_Stream_Record;
Attributes : UTF8_String;
Cancellable : access Glib.Cancellable.Gcancellable_Record'Class;
Error : out Glib.Error.GError) return Glib.File_Info.Gfile_Info
Queries a file output stream for the given Attributes. This function blocks while querying the stream. For the asynchronous version of this function, see Glib.File_Output_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). In 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.
a file attribute query string.
optional Glib.Cancellable.Gcancellable object, null to ignore.
the return location for a recoverable error
a Glib.File_Info.Gfile_Info for the Stream, or null on error. Has transfer-ownership='full'.
procedure Query_Info_Async
(Self : not null access Gfile_Output_Stream_Record;
Attributes : UTF8_String;
Io_Priority : Glib.Gint;
Cancellable : access Glib.Cancellable.Gcancellable_Record'Class;
Callback : Gasync_Ready_Callback)
Asynchronously queries the Stream for a Glib.File_Info.Gfile_Info. When completed, Callback will be called with a Glib.G_Async_Result which can be used to finish the operation with Glib.File_Output_Stream.Query_Info_Finish. For the synchronous version of this function, see Glib.File_Output_Stream.Query_Info.
a file attribute query string.
the [I/O priority][gio-GIOScheduler] of the request
optional Glib.Cancellable.Gcancellable object, null to ignore.
callback to call when the request is satisfied
function Query_Info_Finish
(Self : not null access Gfile_Output_Stream_Record;
Result : Glib.G_Async_Result;
Error : out Glib.Error.GError) return Glib.File_Info.Gfile_Info
Finalizes the asynchronous query started by Glib.File_Output_Stream.Query_Info_Async.
a Glib.G_Async_Result.
the return location for a recoverable error
A Glib.File_Info.Gfile_Info for the finished query. Has transfer-ownership='full'.