Did I find the right examples for you? yes no

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
os.makedirs replacement enabling setting mode, uid and gid for created files 

        def makedirs(path, mode=0755, uid=0, gid=0):
    """ os.makedirs replacement enabling setting mode, uid and gid for created files """
    abspath = ''
    for dirname in path.split(os.path.sep):
        if not dirname:
            abspath += os.path.sep
            continue
        abspath = os.path.join(abspath, dirname)
        if not os.path.exists(abspath):
            os.mkdir(abspath)
            os.chmod(abspath, mode)  # ignore umask
            os.chown(abspath, uid, gid)
        


src/c/o/confine-controller-0.10.5/controller/apps/firmware/image.py   confine-controller(Download)
from django.core.management.base import CommandError
 
from controller.utils.system import run, makedirs
 
from .exceptions import UnexpectedImageFormat
    def create_file(self, build_file):
        dest_path = self.mnt + build_file.name
        dest_dir = os.path.dirname(dest_path)
        if not os.path.exists(dest_dir):
            makedirs(dest_dir, mode=0755, uid=0, gid=0)