install_stream_sync


Description:

[ Version ( since = "1.9" ) ]
public bool install_stream_sync (InstallFlags flags, InputStream stream, ProgressCallback? progress_callback, Cancellable? cancellable = null) throws Error

Install a snap.

The snap contents are provided in the form of an input stream. To install from a local file, do the following:

|[ g_autoptr(GFile) file = g_file_new_for_path (path_to_snap_file); g_autoptr(GInputStream) stream = g_file_read (file, cancellable, &error); snapd_client_install_stream_sync (self, stream, progress_cb, NULL, cancellable, &error); \]

Or if you have the file in memory you can use:

|[ g_autoptr(GInputStream) stream = g_memory_input_stream_new_from_data (data, data_length, free_data); snapd_client_install_stream_sync (self, stream, progress_cb, NULL, cancellable, &error); \]

Parameters:

this

a Client.

flags

a set of InstallFlags to control install options.

stream

a InputStream containing the snap file contents to install.

progress_callback

function to callback with progress.

cancellable

a Cancellable or null.

progress_callback_data

user data to pass to progress_callback.

Returns:

true on success or false on error.




2022 vala-language.org