(It is a memorandum)
When creating a directory in Python os.mkdir(path,[mode]) http://docs.python.jp/2.7/library/os.html#os.mkdir
I use
mkdir_NG_0777
os.mkdir("hoge",0777)
Even though the directory is not created with permission 0777. As stated in the manual, umask is applied, so it will behave as described in the following article. (That is, the second parameter is not the permission setting!)
reference: Permission (umask) when creating a Linux file directory http://qiita.com/yuki2006@github/items/3774bf765eb5ef7deabc
In other words, you have to do the following.
mkdir_OK_0777
os.mkdir("hoge")
os.chmod("hoge",0777)
It feels a bit crappy (redundant), but what about it? .. (Please let me know if there is a good way.
Recommended Posts