MCPcopy Create free account
hub / github.com/catboost/catboost / GetSystemTempDir

Function GetSystemTempDir

util/folder/dirut.cpp:550–565  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

548}
549
550TString GetSystemTempDir() {
551#ifdef _win_
552 char buffer[1024];
553 DWORD size = GetTempPath(1024, buffer);
554 if (!size) {
555 ythrow TSystemError() << "failed to get system temporary directory";
556 }
557 return TString(buffer, size);
558#else
559 const char* var = "TMPDIR";
560 const char* def = "/tmp";
561 const char* r = getenv(var);
562 const char* result = r ? r : def;
563 return result[0] == '/' ? result : ResolveDir(result);
564#endif
565}
566
567TString ResolveDir(const char* path) {
568 return ResolvePath(path, true);

Callers 13

TestMergeFromFileMethod · 0.85
TestMergeFromBufferMethod · 0.85
InitFromEnvMethod · 0.85
TESTFunction · 0.85
ReInitializeContextFunction · 0.85
Y_UNIT_TESTFunction · 0.85
LoadTrainingDataFunction · 0.85
Y_UNIT_TESTFunction · 0.85
MakeTempNameFunction · 0.85

Calls 1

ResolveDirFunction · 0.85

Tested by 4

TestMergeFromFileMethod · 0.68
TestMergeFromBufferMethod · 0.68
LoadTrainingDataFunction · 0.68