根据路径递归创建不存在的文件夹
- 作者: 搞笑Gifs8
- 来源: 51数据库
- 2022-08-12
def my_mkdir(dirPath)
unless File.exist?(dirPath)
my_mkdir(dirPath[0, dirPath.rindex('/')]) if dirPath.rindex('/')
Dir::mkdir dirPath
end
end
my_mkdir('c:/a/b/c/d')
推荐阅读
