V3FIT
|
Functions to fast copy files. More...
#include <sys/errno.h>
#include <fcntl.h>
#include <sys/sendfile.h>
#include <sys/stat.h>
Go to the source code of this file.
Macros | |
#define | COPYFILE_ALL 0 |
Flag to copy the enture file. | |
Functions | |
size_t | copyfile (const char *src, const char *dest, const int unused_1, const int unused_2) |
Copy a file from the source to the destination. More... | |
int | copy_file_c (const char *src, const char *dest) |
Copy a file from the source to the destination. More... | |
Functions to fast copy files.
MPI and calls to fork do not mix well. In place of slow copies this makes Kernel function calls to the OS fast copy systems by passing a fork to the cp command.
Definition in file copy_file.c.
int copy_file_c | ( | const char * | src, |
const char * | dest | ||
) |
Copy a file from the source to the destination.
Copy file returns the error status. Check errno to see the error that occurred.
[in] | src | Path to the source file to copy. |
[in] | dest | Path to the destination file to copy. |
Definition at line 69 of file copy_file.c.
size_t copyfile | ( | const char * | src, |
const char * | dest, | ||
const int | unused_1, | ||
const int | unused_2 | ||
) |
Copy a file from the source to the destination.
Linux does not define the copyfile function. Define one using the sendfile(2) function.
[in] | src | Path to the source file to copy. |
[in] | dest | Path to the destination file to copy. |
[in] | unused_1 | Unused argument. |
[in] | unused_2 | Unused argument. |
Definition at line 35 of file copy_file.c.