当前位置:网站首页>Create directories and subdirectories circularly
Create directories and subdirectories circularly
2022-07-25 12:24:00 【Spring buds and summer lotus_ seven hundred and twenty-eight mi】
void RecursiveDirectory(std::wstring wstrDir)
{
if (wstrDir.length() <= 3)// It's the root directory , No need to create a directory
{
return;
}
if (wstrDir[wstrDir.length() - 1] == L'\\')
{
wstrDir.erase(wstrDir.end() - 1);
}
// Modify file properties
WIN32_FIND_DATA wfd;
HANDLE hFind = FindFirstFile(wstrDir.c_str(), &wfd); // lookup
if (hFind != INVALID_HANDLE_VALUE)
{
FindClose(hFind);
if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
return;
}
// Failed to create the local directory of the current directory
if (CreateDirectory(wstrDir.c_str(), NULL) == false)
{
// Back to a higher directory
std::wstring wstrNewDir = wstrDir;
while (wstrNewDir[wstrNewDir.length() - 1] != L'\\') // Retreat to the previous directory of the current directory
{
wstrNewDir.erase(wstrNewDir.length() - 1);
}
// delete '\'
wstrNewDir.erase(wstrNewDir.length() - 1); // delete '\'
// Recursion into
RecursiveDirectory(wstrNewDir); // Recursion of this function , Then create a directory
// After recursive exit, create the directory that failed before
CreateDirectory(wstrDir.c_str(), NULL); // Recursively returns , Create a directory on the existing directory
}
// Multi level directory created successfully
}
边栏推荐
- Pytorch advanced training skills
- web编程(二)CGI相关
- 基于Caffe ResNet-50网络实现图片分类(仅推理)的实验复现
- Feign使用
- Ups and downs of Apple's supply chain in the past decade: foreign head teachers and their Chinese students
- 【Flutter -- 实例】案例一:基础组件 & 布局组件综合实例
- From cloud native to intelligent, in-depth interpretation of the industry's first "best practice map of live video technology"
- 【7】 Layer display and annotation
- Pytorch main module
- Hystrix使用
猜你喜欢

第一个scrapy爬虫

Transformer variants (routing transformer, linformer, big bird)

Meta learning (meta learning and small sample learning)

【微服务~Sentinel】Sentinel降级、限流、熔断

Heterogeneous graph neural network for recommendation system problems (ackrec, hfgn)

氢能创业大赛 | 国家能源局科技司副司长刘亚芳:构建高质量创新体系是我国氢能产业发展的核心

Application of comparative learning (lcgnn, videomoco, graphcl, XMC GaN)

Atomic 原子类

2.1.2 机器学习的应用

Fault tolerant mechanism record
随机推荐
嵌套事务 UnexpectedRollbackException 分析与事务传播策略
R language ggpubr package ggarrange function combines multiple images and annotates_ Figure function adds annotation, annotation and annotation information for the combined image, adds image labels fo
【3】 DEM mountain shadow effect
【5】 Page and print settings
Week303 of leetcode (20220724)
Ansible
马斯克的“灵魂永生”:一半炒作,一半忽悠
Azure Devops(十四) 使用Azure的私有Nuget仓库
Feign使用
PyTorch可视化
【Flutter -- 实例】案例一:基础组件 & 布局组件综合实例
R语言可视化散点图、使用ggrepel包的geom_text_repel函数避免数据点之间的标签互相重叠(设置min.segment.length参数为Inf不添加标签线段)
scrapy爬虫爬取动态网站
Jenkins配置流水线
web编程(二)CGI相关
Plus版SBOM:流水线物料清单PBOM
OSPF comprehensive experiment
Video caption (cross modal video summary / subtitle generation)
Feign use
Median (two point answer + two point search)