MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / initializeHistoryFile

Method initializeHistoryFile

programs/disks/DisksApp.cpp:427–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425}
426
427void DisksApp::initializeHistoryFile()
428{
429 String home_path;
430 const char * home_path_cstr = getenv("HOME"); // NOLINT(concurrency-mt-unsafe)
431 if (home_path_cstr)
432 home_path = home_path_cstr;
433 if (config().has("history-file"))
434 history_file = config().getString("history-file");
435 else
436 history_file = home_path + "/.disks-file-history";
437
438 if (!history_file.empty() && !fs::exists(history_file))
439 {
440 try
441 {
442 FS::createFile(history_file);
443 }
444 catch (const ErrnoException & e)
445 {
446 if (e.getErrno() != EEXIST)
447 throw;
448 }
449 }
450
451 history_max_entries = config().getUInt("history-max-entries", 1000000);
452}
453
454void DisksApp::init(const std::vector<String> & common_arguments)
455{

Callers

nothing calls this directly

Calls 7

getErrnoMethod · 0.80
existsFunction · 0.50
createFileFunction · 0.50
hasMethod · 0.45
getStringMethod · 0.45
emptyMethod · 0.45
getUIntMethod · 0.45

Tested by

no test coverage detected