From 5a1b9d438e00a855bf34f11012d227f2b6de73cc Mon Sep 17 00:00:00 2001 From: evilhero Date: Mon, 22 Apr 2013 13:12:29 -0400 Subject: [PATCH] FIX:(#356) Folder permissions when created by Mylar --- mylar/filechecker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mylar/filechecker.py b/mylar/filechecker.py index adcf68ee..3fadc893 100755 --- a/mylar/filechecker.py +++ b/mylar/filechecker.py @@ -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