Name
ec_copy_file — Copy a file from one location to another
Synopsis
#include "util.h"
| int **ec_copy_file** (
| srcpath, | |
| | destpath, | |
| | flags, | |
| | mode)
; | |
const char * <var class="pdparam">srcpath</var>
;
const char * <var class="pdparam">destpath</var>
;
int <var class="pdparam">flags</var>
;
int <var class="pdparam">mode</var>
;
Description
Copy a file from one location to another.
- srcpath
-
The location of the source file.
- destpath
-
The location of the destination file.
- flags
-
The file creation flags for the destination
open()
call. For valid flags seeman open
. - mode
-
The mode for the destination file. For valid modes see
man open
.
This is a convenience wrapper that opens both files and then copies data from the source to the destination.
This function returns 0
on success.
It is legal to call this function in any thread.