MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / FileCopy

Method FileCopy

cpp/src/platform/windows/FileOpsImpl.cpp:130–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128
129
130bool FileOpsImpl::FileCopy
131(
132 const string _sourcefile,
133 const string _destfile
134)
135{
136
137 if (!FileExists(_sourcefile)) {
138 Log::Write(LogLevel_Warning, "Source File %s doesn't exist in FileCopy", _sourcefile.c_str());
139 return false;
140 }
141 if (FileExists(_destfile)) {
142 Log::Write(LogLevel_Warning, "Destination File %s exists in FileCopy", _destfile.c_str());
143 return false;
144 }
145
146 /* make sure the Destination Folder Exists */
147 if (!FolderExists(ozwdirname(_destfile))) {
148 Log::Write(LogLevel_Warning, "Destination Folder %s Doesn't Exist", ozwdirname(_destfile));
149 return false;
150 }
151
152 if (CopyFileA(_sourcefile.c_str(), _destfile.c_str(), FALSE) == 0) {
153 Log::Write(LogLevel_Warning, "CopyFile Failed %s - %s", _sourcefile.c_str(), _destfile.c_str());
154 return false;
155 }
156 return true;
157}
158
159bool FileOpsImpl::FolderCreate
160(

Callers

nothing calls this directly

Calls 2

WriteFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected