Bab*_*bel 7 python directory operating-system createfile
我正在尝试在文件夹中创建一个文件夹,首先我检查该目录是否存在并在必要时创建它:
name = "User1"
if not os.path.exists("/pdf_files/%s" % name):
os.makedirs('/pdf_files/%s' % name )
Run Code Online (Sandbox Code Playgroud)
问题是我收到了一个错误: OSError: [Errno 13] Permission denied: '/pdf_files'
这个名为的文件夹:pdf_file我创建的文件夹具有所有权限:drwxrwxrwx或'777'
我搜索了这个,我看到了一些解决方案,但没有一个解决了我的问题.有人能帮助我吗?
| 归档时间: |
|
| 查看次数: |
11871 次 |
| 最近记录: |