1.1 --- a/imiptools/filesys.py Thu Feb 12 16:39:06 2015 +0100
1.2 +++ b/imiptools/filesys.py Thu Feb 12 17:01:55 2015 +0100
1.3 @@ -20,7 +20,7 @@
1.4 """
1.5
1.6 import errno
1.7 -from imiptools.config import DEFAULT_PERMISSIONS
1.8 +from imiptools.config import DEFAULT_PERMISSIONS, DEFAULT_DIR_PERMISSIONS
1.9 from os.path import abspath, commonprefix, exists, join
1.10 from os import chmod, makedirs, mkdir, rmdir
1.11 from time import sleep, time
1.12 @@ -28,9 +28,9 @@
1.13 def check_dir(base, dir):
1.14 return commonprefix([base, abspath(dir)]) == base
1.15
1.16 -def fix_permissions(filename):
1.17 +def fix_permissions(filename, is_dir=False):
1.18 try:
1.19 - chmod(filename, DEFAULT_PERMISSIONS)
1.20 + chmod(filename, is_dir and DEFAULT_DIR_PERMISSIONS or DEFAULT_PERMISSIONS)
1.21 except OSError:
1.22 pass
1.23