linux

#include <sys/types.h>
#include <sys/stat.h>

string filepath;
mkdir(filepath.c_str(), 0777);

注意,成功创建文件夹mkdir返回值为0,否则为-1。另外,如果文件夹已存在,则返回-1。

文件目录只能一级级的创建,不能直接创建多级目录。

window

 

相关文章:

  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2021-06-28
  • 2021-08-14
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2022-01-01
相关资源
相似解决方案