|
a/src/utils/copyfile.h |
|
b/src/utils/copyfile.h |
|
... |
|
... |
16 |
*/
|
16 |
*/
|
17 |
#ifndef _COPYFILE_H_INCLUDED_
|
17 |
#ifndef _COPYFILE_H_INCLUDED_
|
18 |
#define _COPYFILE_H_INCLUDED_
|
18 |
#define _COPYFILE_H_INCLUDED_
|
19 |
|
19 |
|
20 |
#include <string>
|
20 |
#include <string>
|
21 |
using std::string;
|
|
|
22 |
|
21 |
|
23 |
enum CopyfileFlags {COPYFILE_NONE = 0, COPYFILE_NOERRUNLINK = 1};
|
22 |
enum CopyfileFlags {COPYFILE_NONE = 0,
|
|
|
23 |
COPYFILE_NOERRUNLINK = 1,
|
|
|
24 |
COPYFILE_EXCL = 2,
|
|
|
25 |
};
|
24 |
|
26 |
|
|
|
27 |
/** Copy src to dst.
|
|
|
28 |
*
|
|
|
29 |
* We destroy an existing dst except if COPYFILE_EXCL is set (or we if
|
|
|
30 |
* have no permission...).
|
|
|
31 |
* A partially copied dst is normally removed, except if COPYFILE_NOERRUNLINK
|
|
|
32 |
* is set.
|
|
|
33 |
*/
|
25 |
extern bool copyfile(const char *src, const char *dst, string &reason,
|
34 |
extern bool copyfile(const char *src, const char *dst, std::string &reason,
|
26 |
int flags = 0);
|
35 |
int flags = 0);
|
27 |
|
36 |
|
28 |
// Try to rename, copy/unlink source if this fails (different devs)
|
37 |
/** Try to rename src. If this fails (different devices) copy then unlink src */
|
29 |
extern bool renameormove(const char *src, const char *dst, string &reason);
|
38 |
extern bool renameormove(const char *src, const char *dst, std::string &reason);
|
30 |
|
39 |
|
31 |
#endif /* _COPYFILE_H_INCLUDED_ */
|
40 |
#endif /* _COPYFILE_H_INCLUDED_ */
|