MCPcopy Create free account
hub / github.com/acl-dev/acl / copy_file

Function copy_file

app/gson/src/main.cpp:14–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12}
13
14static bool copy_file(const char* from, const char* to)
15{
16 acl::string buf;
17 if (acl::ifstream::load(from, &buf) == false)
18 {
19 printf("read %s error %s\r\n", from, acl::last_serror());
20 return false;
21 }
22
23 acl::ofstream out;
24 if (out.open_trunc(to) == false)
25 {
26 printf("open %s error %s\r\n", to, acl::last_serror());
27 return false;
28 }
29
30 if (out.write(buf) == -1)
31 {
32 printf("write to %s error %s\r\n", to, acl::last_serror());
33 return false;
34 }
35
36 return true;
37}
38
39static bool copy_files(const char* to_path)
40{

Callers 2

copy_filesFunction · 0.70
scan_pathFunction · 0.70

Calls 3

last_serrorFunction · 0.50
open_truncMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…