lcg_set_transfer_callback(3) - Linux man page

Name

lcg_set_transfer_callback - Get/Set the pointer of the transfer

file callback

Synopsis

#include "lcg_util.h"

void lcg_set_transfer_callback (copyfile_callback_t *cb);

copyfile_callback_t lcg_get_transfer_callback ();

Description

lcg_set_transfer_callback sets the pointer of the transfer file callback
cb
specifies the pointer to the desired function.

typedef struct {
GFAL_LONG64 transferred_bytes;
float instant_throughput;
float avg_throughput;
} perf_t;

typedef void (* copyfile_callback_t) (
perf_t s_perf,
struct timespec ts,
int *timeoutflg
);

Example

Here is the function which is used in verbose mode:

void copy_print_callback(perf_t perf, struct timespec ts, int *timeoutflg) {
fprintf(stderr,"\r %12lld bytes", (GFAL_LONG64)perf.transferred_bytes);
fprintf(stderr," %9.2lf KB/sec avg", (double)perf.avg_throughput/1024);
fprintf(stderr," %9.2lf KB/sec inst", (double)perf.instant_throughput/1024);
}

Files

/opt/lcg/include/lcg_util.h
/opt/lcg/lib/liblcg_util.so

See Also

lcg_cp(3), lcg_cr(3), lcg_del(3), lcg_gt(3), lcg_la(3), lcg_lg(3), lcg_lr(3), lcg_ra(3), lcg_rep(3), lcg_rf(3), lcg_sd(3), lcg_stmd(3), lcg_uf(3)