本文介绍了在C ++中创建目录树的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Windows上使用C ++中的任何函数(win32或MFC) 1)在给定路径下创建目录树。 ,例如如果path是c\Test1\Test2\Test3 那么该函数应该创建磁盘上不存在的所有目录。 我知道我们可以通过标记路径并在每个directoey上使用 CreateDirectory 函数来实现这一点,但我正在寻找一个现成的函数来完成这项任务。
Hi, Is ther any function in C++ on windows(win32 or MFC) for 1 ) Creating a directory tree at given path. e.g. if path is c\Test1\Test2\Test3 Then the function should create all directories which does not exist on the disk. I know we can achieve this by tokenizing the path and using CreateDirectory function on each directoey, but i am looking for a readymade function to do this task.
推荐答案是的,有这样一个功能: SHCreateDirectoryEx [ ^ ]。要使用它,您必须包含 shlobj.h 并链接 shell32.lib 。 Yes, there is such a function: SHCreateDirectoryEx [^]. To use it you must include shlobj.h and link with shell32.lib.
更多推荐
在C ++中创建目录树的功能
发布评论