windows平台下一次创建多级目录
来源:互联网 发布:nginx 二级域名重定向 编辑:程序博客网 时间:2024/06/06 02:22
该代码用于一次性创建多级目录:
#include <io.h>#include <iostream>#include <Windows.h>#include <direct.h>int main(){char szPath[128] = { 0x00 };sprintf_s(szPath, 128, "%s/%d/%d/", "D:/SVNCode", 10100703, 1);char* szBefore = szPath;while (*szBefore){if (*szBefore == '/'){char szDir[128] = { 0x00 };strncpy_s(szDir, 128,szPath, szBefore - szPath);int nRet = 0;if (_access(szDir, 0) != 0)nRet = _mkdir(szDir);}szBefore++;}if (_access(szPath, 0) != 0)_mkdir(szPath);DWORD dwError = GetLastError();int n = 0;return 0;}
阅读全文
0 0
- windows平台下一次创建多级目录
- C++Windows下创建多级目录
- 创建多级目录
- php创建多级目录
- SHCreateDirectoryEx 创建多级目录
- VC创建多级目录
- C++ 创建多级目录
- 递归创建多级目录
- 创建多级目录
- 创建多级目录
- 创建多级目录
- VB创建多级目录
- 创建多级目录
- C++ 创建多级目录
- 多级目录创建
- VC创建多级目录
- 创建多级目录
- 创建多级文件夹目录
- keil c51/keil4 安装教程
- (转)最近100年全球最顶尖公司的共性
- 图的表示
- BZOJ 1012: [JSOI2008]最大数maxnumber
- HTTP报文(http权威指南第三章)
- windows平台下一次创建多级目录
- 选择状态
- C语言判断一个数是否为素数
- 堆排序
- HTTP简介
- Libevent源码分析-----信号event的处理
- arm+Linux
- python接口测试:post传入参数为base64的加密数据
- LeetCode 77. Combinations 组合问题C(n,k),树形状态回溯,优化减枝