当前位置: 首页>>代码示例>>C++>>正文


C++ CDirectory::remove_dir方法代码示例

本文整理汇总了C++中CDirectory::remove_dir方法的典型用法代码示例。如果您正苦于以下问题:C++ CDirectory::remove_dir方法的具体用法?C++ CDirectory::remove_dir怎么用?C++ CDirectory::remove_dir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CDirectory的用法示例。


在下文中一共展示了CDirectory::remove_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();
}
开发者ID:leslieyuchen,项目名称:kunlun,代码行数:101,代码来源:storage_server.cpp


注:本文中的CDirectory::remove_dir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。