c ++如何从路径创建目录 [英] c++ how to create a directory from a path

查看:150
本文介绍了c ++如何从路径创建目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



请注意,当提供这样的路径时,什么是创建目录的方便方法:中间目录可能不存在。



CreateDirectory和mkdir只是似乎创建一个目录的最后一部分,否则会给出错误。



平台是windows,MSVC编译器。



谢谢!

解决方案/ div>

SHCreateDirectoryEx()可以做到这一点它可用于XP SP2和较新版本的Windows。


what is a convenient way to create a directory when a path like this is given: "\server\foo\bar\"

note that the intermediate directories may not exist.

CreateDirectory and mkdir only seem to create the last part of a directory and give an error otherwise.

the platform is windows, MSVC compiler.

thanks!

解决方案

SHCreateDirectoryEx() can do that. It's available on XP SP2 and newer versions of Windows.

这篇关于c ++如何从路径创建目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆