1
0
Fork 0
mirror of https://github.com/evilhero/mylar synced 2024-12-24 00:32:47 +00:00

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

View file

@ -21,6 +21,7 @@ import subprocess
import re import re
import logger import logger
import mylar import mylar
import sys
def file2comicmatch(watchmatch): def file2comicmatch(watchmatch):
#print ("match: " + str(watchmatch)) #print ("match: " + str(watchmatch))
@ -127,7 +128,9 @@ def validateAndCreateDirectory(dir, create=False):
if dir.strip(): if dir.strip():
logger.info("Creating comic directory ("+str(mylar.CHMOD_DIR)+") : " + dir) logger.info("Creating comic directory ("+str(mylar.CHMOD_DIR)+") : " + dir)
try: 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: except OSError:
raise SystemExit('Could not create data directory: ' + mylar.DATA_DIR + '. Exiting....') raise SystemExit('Could not create data directory: ' + mylar.DATA_DIR + '. Exiting....')
return True return True