Skip to content

Instantly share code, notes, and snippets.

@dcragusa
Created September 20, 2018 14:01
Show Gist options
  • Save dcragusa/c430f1f53fbce7d7d81d81de963bba21 to your computer and use it in GitHub Desktop.
Save dcragusa/c430f1f53fbce7d7d81d81de963bba21 to your computer and use it in GitHub Desktop.
Make a 775 directory on the filesystem (all perms for owner and group, read/execute for everyone else)
def make_775_dir(dir_fp: str):
original_umask = os.umask(0)
try:
os.makedirs(dir_fp, mode=0o775, exist_ok=True)
except IOError:
# weird folder permission issues
pass
finally:
os.umask(original_umask)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment