#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdint.h>
Go to the source code of this file.
◆ BUF_SIZE
◆ copyfile()
int copyfile |
( |
int |
fromfd, |
|
|
int |
tofd |
|
) |
| |
Copy a file to another file
- Parameters
-
fromfd | file descriptor of the source file |
tofd | file descriptor of the destination file |
- Returns
- -1 on errors and 0 otherwise
◆ copyfile_byname()
int copyfile_byname |
( |
const char * |
fromname, |
|
|
const char * |
toname |
|
) |
| |
Copy a file to another file
- Parameters
-
fromname | file path of the source file |
toname | file path of the destination file |
- Returns
- -1 on errors and 0 otherwise
◆ copyfile_seg()
int copyfile_seg |
( |
int |
infd, |
|
|
int |
outfd, |
|
|
uint64_t |
pos, |
|
|
int64_t |
count |
|
) |
| |
Copy a segment of a file to another file
- Parameters
-
infd | file descriptor of the source file |
outfd | file descriptor of the destination file |
pos | offset within the source file |
count | amount of bytes to be copied |
- Returns
- -1 on errors and 0 otherwise