399 m_bReadOnly = readOnly;
415 if (bGetDataFolderSuccess) {
433 std::ifstream pid_infile(strPIDPath.Get());
436 if (pid_infile.is_open()) {
437 uint32_t old_pid = 0;
438 pid_infile >> old_pid;
443 uint64_t lPID = old_pid;
445 "\n\n\nIS OPEN-TRANSACTIONS ALREADY RUNNING?\n\n"
446 "I found a PID (%llu) in the data lock file, located "
448 "If the OT process with PID %llu is truly not running "
450 "then just ERASE THAT FILE and then RESTART.\n",
451 lPID, strPIDPath.Get(), lPID);
462 uint64_t the_pid = 0;
465 the_pid = GetCurrentProcessId();
471 std::ofstream pid_outfile(strPIDPath.Get());
473 if (pid_outfile.is_open()) {
474 pid_outfile << the_pid;
479 "store PID %llu): %s\n",
480 the_pid, strPIDPath.Get());
487 bool mainFileExists = m_strWalletFilename.
Exists()
491 if (!mainFileExists) {
494 "Error: Main file non-existent (%s). "
495 "Plus, unable to create, since read-only flag is set.\n",
496 m_strWalletFilename.
Get());
500 std::string strContract;
501 std::string strServerID;
503 std::string strNymID;
504 std::string strCachedKey;
505 askInteractively(strContract, strServerID, strCert, strNymID,
508 strContract, strServerID, strCert, strNymID, strCachedKey);
512 if (mainFileExists) {
static EXPORT void vError(const char *szError,...)
#define SERVER_PID_FILENAME
#define OTDB_DEFAULT_PACKER
EXPORT bool InitDefaultStorage(StorageType eStoreType, PackType ePackType)
static EXPORT bool IsInitialized()
EXPORT bool Exists() const
static bool load(OTString &walletFilename)
bool LoadMainFile(bool readOnly=false)
EXPORT const char * Get() const
EXPORT bool Exists(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
bool CreateMainFile(const std::string &strContract, const std::string &strServerID, const std::string &strCert, const std::string &strNymID, const std::string &strCachedKey)
#define OTDB_DEFAULT_STORAGE
static EXPORT bool AppendFile(OTString &out_strPath, const OTString &strBasePath, const OTString &strFileName)
static EXPORT OTString Get()