本文整理汇总了C++中CDirectory::make_dir方法的典型用法代码示例。如果您正苦于以下问题:C++ CDirectory::make_dir方法的具体用法?C++ CDirectory::make_dir怎么用?C++ CDirectory::make_dir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDirectory
的用法示例。
在下文中一共展示了CDirectory::make_dir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initilize
//.........这里部分代码省略.........
}
catch(std::bad_alloc)
{
m_psync_thread = NULL;
KL_SYS_ERRORLOG("file: "__FILE__", line: %d, " \
"no more memory to create storage sync thread", \
__LINE__);
return ENOMEM;
}
catch(int errcode)
{
m_psync_thread = NULL;
KL_SYS_ERRORLOG("file: "__FILE__", line: %d, " \
"call CThread constructor failed, err: %s", \
__LINE__, strerror(errcode));
return errcode;
}
//create beat-hearting thread to report
try
{
m_ppreport_threads = new CThreadPtr[proxy_addr_list.size()];
}
catch(std::bad_alloc)
{
m_ppreport_threads = NULL;
}
if(m_ppreport_threads == NULL)
{
KL_SYS_ERRORLOG("file: "__FILE__", line: %d, " \
"no more memory to create report thread array", \
__LINE__);
return ENOMEM;
}
//create a report thread to each proxynode
for(nthread_curr = 0; nthread_curr < proxy_addr_list.size(); nthread_curr++)
{
try
{
pbeat_heart_func = new CThreadBeatHeart(proxy_addr_list[nthread_curr], \
m_psync_msg_queue, nthread_curr);
}
catch(std::bad_alloc)
{
pbeat_heart_func = NULL;
}
catch(int errcode)
{
KL_SYS_ERRORLOG("file: "__FILE__", line: %d, " \
"call CThreadBeatHeart constructor failed, err: %s", \
__LINE__, strerror(errcode));
return errcode;
}
if(pbeat_heart_func == NULL)
{
KL_SYS_ERRORLOG("file: "__FILE__", line: %d, " \
"no more memory to create beat-hearting function", \
__LINE__);
return ENOMEM;
}
try
{
m_ppreport_threads[nthread_curr] = new CThread(pbeat_heart_func, \
m_storage_server_conf.nthread_stack_size);
}
catch(std::bad_alloc)
{
m_ppreport_threads[nthread_curr] = NULL;
}
catch(int errcode)
{
KL_SYS_ERRORLOG("file: "__FILE__", line: %d, " \
"call CThread constructor failed, err: %s", \
__LINE__, strerror(errcode));
return errcode;
}
if(m_ppreport_threads[nthread_curr] == NULL)
{
KL_SYS_ERRORLOG("file: "__FILE__", line: %d, " \
"no more memory to create beat-hearting thread", \
__LINE__);
return ENOMEM;
}
}
//make device root dir
if(dir.dir_exist(g_device_root))
{
dir.remove_dir(g_device_root);
}
if((ret = dir.make_dir(g_device_root)) != 0)
{
KL_SYS_ERRORLOG("file: "__FILE__", line: %d, " \
"make device root dir failed, dir_path: %s, err: %s", \
__LINE__, g_device_root, strerror(ret));
return ret;
}
//do base server initilize
return CBaseServer::initilize();
}