mkdir
CreateDirectory好像都只能一次创建一层的。。
CreateDirectory好像都只能一次创建一层的。。
解决方案 »
- 请问用CreateFile得到的文件句柄,用什么方法获得文件指针的当前位置?
- 如何判断提供字母中能否组合成单词?
- 请问通过那个oid可以获得snmp设备启动的服务?
- 一个edit控件的问题
- 关于系统对话框的汉字变英文的问题???
- 大家说这样的线程有没有问题?
- 记录操作问题
- 在mdi下,如何在view中得到他的cchildframe的pointer,谢谢
- 在atl中添加一个控制,在里面申请了一些资源,当控件释放时释放这些资源,怎么搞?我找不到析够函数!
- 两机用winsock联接后,怎么才能远程访问对方的硬盘?(象自己的硬盘一样)
- 讨论一下WSARecv和WSASend的问题
- 用data_seg时遇到的问题
#include <direct.h>
#include <string>using namespace std;#ifdef _UNICODE
#define string wstring
#endifvoid ForceDirectory(const TCHAR* szPath)
{
if (_taccess(szPath, 0) != -1) return; string sPath = szPath; // 添加尾端斜杠
if (sPath.substr(sPath.length() - 1, 1) != _T("\\"))
sPath += _T("\\"); int nEnd = sPath.rfind(_T("\\"));
int nPos = sPath.find(_T("\\"));
if (sPath[nPos - 1] == _T(':'))
nPos = sPath.find(_T("\\"), nPos + 1);
while( nPos != string::npos && nPos <= nEnd )
{
string path = sPath.substr(0, nPos + 1);
if(_taccess(path.c_str(), 0) == -1)
_tmkdir(path.c_str()); nPos = sPath.find(_T("\\"), nPos + 1);
}
}
如果发现有一层的文件夹未create,则接着一层一层创建文件夹
api就没有一个这样的东西??