| 128 | |
| 129 | |
| 130 | bool 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 | |
| 159 | bool FileOpsImpl::FolderCreate |
| 160 | ( |