MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / dumpFile

Function dumpFile

src/env.cpp:1142–1171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1140}
1141
1142HandlePtr dumpFile(const wchar_t* dir)
1143{
1144 // try the given directory, if any
1145 if (dir) {
1146 HandlePtr h = tempFile(dir);
1147 if (h.get() != INVALID_HANDLE_VALUE) {
1148 return h;
1149 }
1150 }
1151
1152 // try the current directory
1153 HandlePtr h = tempFile(L".");
1154 if (h.get() != INVALID_HANDLE_VALUE) {
1155 return h;
1156 }
1157
1158 std::wclog << L"cannot write dump file in current directory\n";
1159
1160 // try the temp directory
1161 const auto temp = tempDir();
1162
1163 if (!temp.empty()) {
1164 h = tempFile(temp.c_str());
1165 if (h.get() != INVALID_HANDLE_VALUE) {
1166 return h;
1167 }
1168 }
1169
1170 return {};
1171}
1172
1173CoreDumpTypes coreDumpTypeFromString(const std::string& s)
1174{

Callers 1

createMiniDumpFunction · 0.85

Calls 4

tempFileFunction · 0.85
tempDirFunction · 0.85
getMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected