![]() |
![]() |
![]() |
atomic-install Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <atomic-install/copy.h> int ai_cp_a (const char *source
,const char *dest
); int ai_cp_l (const char *source
,const char *dest
); int ai_mv (const char *source
,const char *dest
);
libai-copy provides a few convenience functions to copy and move files, preserving their ownership, permissions, mtimes and extended attributes.
int ai_cp_a (const char *source
,const char *dest
);
Copy the contents and attributes of source
file to dest
. Preserve
permissions, extended attributes, mtime. Try to copy as fast as possible
but always create a new file.
If source
is a directory, then a new directory will be created at dest
,
and permissions and extended attributes will be copied from source
.
The destination directory must not exist.
|
current file path |
|
new complete file path |
Returns : |
0 on success, errno value on failure. |
int ai_cp_l (const char *source
,const char *dest
);
Create a copy of file source
as dest
as atomically as possible. Preserve
permissions, extended attributes, mtime. The resulting file may be a hardlink
to the source file.
|
current file path |
|
new complete file path |
Returns : |
0 on success, errno value on failure. |