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

This commit is contained in:
evilhero 2013-04-22 13:17:26 -04:00
parent 25b5dcdd9a
commit c480de24c1
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 redundant, but it doesn't hurt to clear the umask here.
os.makedirs(dir, permission)
except OSError:
raise SystemExit('Could not create data directory: ' + mylar.DATA_DIR + '. Exiting....')
return True