File Transfer Task

File Transfer Task — Monitoring file transfers

Stability Level

Stable, unless otherwise indicated

Synopsis

#include <spice-client.h>

double              spice_file_transfer_task_get_progress
                                                        (SpiceFileTransferTask *self);
char *              spice_file_transfer_task_get_filename
                                                        (SpiceFileTransferTask *self);
guint64             spice_file_transfer_task_get_total_bytes
                                                        (SpiceFileTransferTask *self);
guint64             spice_file_transfer_task_get_transferred_bytes
                                                        (SpiceFileTransferTask *self);
void                spice_file_transfer_task_cancel     (SpiceFileTransferTask *self);

Description

SpiceFileTransferTask is an object that represents a particular file transfer between the client and the guest. The properties and signals of the object can be used to monitor the status and result of the transfer. The Main Channel's "new-file-transfer" signal will be emitted whenever a new file transfer task is initiated.

Details

spice_file_transfer_task_get_progress ()

double              spice_file_transfer_task_get_progress
                                                        (SpiceFileTransferTask *self);

Convenience function for retrieving the current progress of this file transfer task.

self :

a file transfer task

Returns :

A fractional value between 0 and 1.0

Since 0.31


spice_file_transfer_task_get_filename ()

char *              spice_file_transfer_task_get_filename
                                                        (SpiceFileTransferTask *self);

Gets the name of the file being transferred in this task

self :

a file transfer task

Returns :

The basename of the file. [transfer full]

Since 0.31


spice_file_transfer_task_get_total_bytes ()

guint64             spice_file_transfer_task_get_total_bytes
                                                        (SpiceFileTransferTask *self);

Gets the total size in bytes of the file transfer.

self :

a file transfer task

Returns :

The total size of the file transfer

Since 0.33


spice_file_transfer_task_get_transferred_bytes ()

guint64             spice_file_transfer_task_get_transferred_bytes
                                                        (SpiceFileTransferTask *self);

Gets the number of bytes that have been transferred so far.

self :

a file transfer task

Returns :

The number of transferred bytes

Since 0.33


spice_file_transfer_task_cancel ()

void                spice_file_transfer_task_cancel     (SpiceFileTransferTask *self);

Cancels the file transfer task. Note that depending on how the file transfer was initiated, multiple file transfer tasks may share a single "cancellable" object, so canceling one task may result in the cancellation of other tasks.

self :

a file transfer task

Since 0.31

See Also

SpiceMainChannel