libite 2.6.1
|
Go to the source code of this file.
Functions | |
ssize_t | copyfile (const char *src, const char *dst, int len, int opt) |
int | movefile (const char *src, const char *dst) |
int | fcopyfile (FILE *src, FILE *dst) |
ssize_t copyfile | ( | const char * | src, |
const char * | dst, | ||
int | len, | ||
int | opt ) |
Copy a file to another.
src | Full path name to source file. |
dst | Full path name to target file. |
len | Number of bytes to copy, zero (0) for entire file. |
opt | An option mask of LITE_FOPT_COPYFILE_SYM, LITE_FOPT_KEEP_MTIME |
This is a C implementation of the command line cp(1) utility. It is one of the classic missing links in the UNIX C library. This version is from the finit project, http://helllabs.org/finit/, which is a reimplementation of fastinit for the Asus EeePC.
The opt field replaces the sym argument in previous releases and works as follows. To maintain backwards compatibility with sym the LITE_FOPT_COPYFILE_SYM has a value of 1
. Supported option flags are:
EISDIR | if src is a directory, since copyfile() is not recursive. |
Definition at line 144 of file copyfile.c.
int fcopyfile | ( | FILE * | src, |
FILE * | dst ) |
Copy between FILE *fp.
src | Source FILE. |
dst | Destination FILE. |
Definition at line 278 of file copyfile.c.
int movefile | ( | const char * | src, |
const char * | dst ) |
Move a file to another location
src | Source file. |
dst | Target file, or location. |
This is a C implementation of the command line mv(1) utility. Usually the rename() API is sufficient, but not when moving across file system boundaries.
The src
argument must include the full path to the source file, whereas the dst
argument may only be a directory, in which case the same file name from src
is used.
Definition at line 244 of file copyfile.c.