Component copyfile
Component index
Section index

Component copyfile


Search

Type

Function

Summary

Copy a file into another

Description

This is like the file_copy function, but with some goodies to track the copy process.

void fail (const char *src, const char *dst, const char *details)
void progress (const char *src, const char *dst, size_t size, size_t sofar, bool &end)

Examples

sample / copyfile component

Prototypes

int copyfile (const char *src, const char *dst)

Return -1 if any error

Functags

void fail (const char *src, const char *dst, const char *details) Optional

Is called whenever there is a failure

The copy is ended and you are informed about it. The default behavior is to report the error with tlmp_error()

void progress (const char *src, const char *dst, size_t size, size_t sofar, bool &end) Optional

Called every once in a while to inform about the amount copied so far

It is generally used to present a progress bar. The default is to do nothing.