| 12 | } |
| 13 | |
| 14 | static 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 | |
| 39 | static bool copy_files(const char* to_path) |
| 40 | { |
no test coverage detected
searching dependent graphs…