[ Version ( since = "0.35" ) ]
public async bool file_copy_async (File[] sources, FileCopyFlags flags, Cancellable? cancellable, FileProgressCallback? progress_callback) throws Error

Copies the file sources to guest

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 returned.

If progress_callback is not null, then the operation can be monitored by setting this to a FileProgressCallback function. progress_callback_data will be passed to this function. It is guaranteed that this callback will be called after all data has been transferred with the total number of bytes copied during the operation. Note that before release 0.31, progress_callback was broken since it only provided status for a single file transfer, but did not provide a way to determine which file it referred to. In release 0.31, this behavior was changed so that progress_callback provides the status of all ongoing file transfers. If you need to monitor the status of individual files, please connect to the new_file_transfer signal.

When the operation is finished, callback will be called. You can then call main_file_copy_async.end to get the result of the operation. Note that before release 0.33 the callback was called for each file in multiple file transfer. This behavior was changed for the same reason as the progress_callback (above). If you need to monitor the ending of individual files, you can connect to "finished" signal from each SpiceFileTransferTask.



a MainChannel


a null-terminated array of File objects to be transferred


set of FileCopyFlags


optional Cancellable object, null to ignore


function to callback with progress information, or null if progress information is not needed


a TaskReadyCallback to call when the request is satisfied


user data to pass to progress_callback


the data to pass to callback function