Creating a directory In C or C++

前端 未结 4 1449
悲&欢浪女
悲&欢浪女 2021-01-18 11:44

How to create a directory with C code (other than the method of forking and using mkdir) ? Is there anything like dirent.h? dirent.h only allows to read directories. (withou

4条回答
  •  醉梦人生
    2021-01-18 12:07

    If you can use C++ (as suggested by the selected tags) and boost libraries, Boost filesystem can help you with the create_directory function.

    If you don't want to have all boost libraries available in your project, you may download a tool called bcp to extract only the subset you need, in your case boost filesystem and its dependencies.

提交回复
热议问题