MCPcopy Create free account
hub / github.com/apitrace/apitrace / copyWrapper

Function copyWrapper

cli/cli_trace.cpp:63–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61#ifdef _WIN32
62
63static inline bool
64copyWrapper(const os::String & wrapperPath,
65 const char *programPath,
66 bool verbose)
67{
68 os::String wrapperFilename(wrapperPath);
69 wrapperFilename.trimDirectory();
70
71 os::String tmpWrapper(programPath);
72 tmpWrapper.trimFilename();
73 tmpWrapper.join(wrapperFilename);
74
75 if (verbose) {
76 std::cerr << wrapperPath << " -> " << tmpWrapper << "\n";
77 }
78
79 if (tmpWrapper.exists()) {
80 std::cerr << "error: not overwriting " << tmpWrapper << "\n";
81 return false;
82 }
83
84 if (!os::copyFile(wrapperPath, tmpWrapper, false)) {
85 std::cerr << "error: failed to copy " << wrapperPath << " into " << tmpWrapper << "\n";
86 return false;
87 }
88
89 return true;
90}
91
92#endif /* _WIN32 */
93

Callers 1

traceProgramFunction · 0.85

Calls 2

copyFileFunction · 0.85
existsMethod · 0.45

Tested by

no test coverage detected