Permission problems when creating a dir with os.makedirs in Python

后端 未结 4 912
误落风尘
误落风尘 2020-12-03 04:41


I\'m simply trying to handle an uploaded file and write it in a working dir which name is the system timestamp. The problem is that I want to create that directory wi

4条回答
  •  北海茫月
    2020-12-03 04:49

    According to the official python documentation the mode argument of the os.makedirs function may be ignored on some systems, and on systems where it is not ignored the current umask value is masked out.

    Either way, you can force the mode to 0o777 (0777 threw up a syntax error) using the os.chmod function.

提交回复
热议问题