FIX:(#356) Folder permissions when created by Mylar

This commit is contained in:
evilhero 2013-04-22 13:12:29 -04:00
parent 5d624ed0db
commit 5a1b9d438e
1 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,7 @@ import subprocess
import re
import logger
import mylar
import sys
def file2comicmatch(watchmatch):
#print ("match: " + str(watchmatch))
@ -127,7 +128,9 @@ def validateAndCreateDirectory(dir, create=False):
if dir.strip():
logger.info("Creating comic directory ("+str(mylar.CHMOD_DIR)+") : " + dir)
try:
os.makedirs(dir, mode=int(mylar.CHMOD_DIR))
permission = int(mylar.CHMOD_DIR, 8)
os.umask(0) # this is probably redudant, but it doesn't hurt to clear the umask here.
os.makedirs(str(dir), permission )
except OSError:
raise SystemExit('Could not create data directory: ' + mylar.DATA_DIR + '. Exiting....')
return True