Libraries:Gtk:Gio:GFileOutputStream
Types
T
Inherits from:GFileOutputStream provides output streams that write their content to a file.
GFileOutputStream implements Gtk.Gio.GSeekable.T, 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 Gtk.Gio.GSeekable.Tell. To find out if a file output stream supports seeking, use Gtk.Gio.GSeekable.CanSeek.To position a file output stream, use Gtk.Gio.GSeekable.Seek. To find out if a file output stream supports truncating, use Gtk.Gio.GSeekable.CanTruncate. To truncate a file output stream, use Gtk.Gio.GSeekable.Truncate.
Constants
Nil : T
Functions
GetType() : Gtk.GObject.Type.T
Methods
:GetEtag(self @ T) : Std.String.T
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.
stream | a T. |
Returns | the entity tag for the stream. |
:Priv(self @ T) : Std.Object.T
:QueryInfo(self @ T, attributes @ Std.String.T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Gtk.Gio.GFileInfo.T
Queries a file output stream for the given attributes. This function blocks while querying the stream. For the asynchronous version of this function, see QueryInfoAsync. While the stream is blocked, the stream will set the pending flag internally, and any other operations on the stream will fail with Gtk.Gio.GIOErrorEnum.Pending.
Can fail if the stream was already closed (with error being set to Gtk.Gio.GIOErrorEnum.Closed), the stream has pending operations (with error being set to Gtk.Gio.GIOErrorEnum.Pending), or if querying info is not supported for the stream's interface (with error being set to Gtk.Gio.GIOErrorEnum.NotSupported). 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 Gtk.Gio.GIOErrorEnum.Cancelled will be set, and NULL will be returned.
stream | a T. |
attributes | a file attribute query string. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. |
error | a Gtk.Glib.GError.T, NULL to ignore. |
Returns | a Gtk.Gio.GFileInfo.T for the stream, or NULL on error. [transfer full] |
:QueryInfoAsync(self @ T, attributes @ Std.String.T, io_priority @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Asynchronously queries the stream for a Gtk.Gio.GFileInfo.T. When completed, callback will be called with a Gtk.Gio.GAsyncResult.T which can be used to finish the operation with QueryInfoFinish.
For the synchronous version of this function, see QueryInfo.
stream | a T. |
attributes | a file attribute query string. |
io_priority | the I/O priority of the request. |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. |
callback | callback to call when the request is satisfied |
user_data | the data to pass to callback function |
:QueryInfoFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Gtk.Gio.GFileInfo.T
Finalizes the asynchronous query started by QueryInfoAsync.
stream | a T. |
result | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T, NULL to ignore. |
Returns | A Gtk.Gio.GFileInfo.T for the finished query. [transfer full] |