Every line of 'python mkdirs' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
146 def mkdirs(*args: Path) -> None: 147 for dir in args: 148 dir.mkdir(parents=True, exist_ok=True)
6 def mkdirs(dirname): 7 """Recurcively (and safely) create dir 8 It is equivalent to mkdir -p dirname 9 """ 10 11 try: 12 os.makedirs(dirname) 13 except OSError as exc: 14 if exc.errno != errno.EEXIST: 15 raise exc
105 def makedirs(name, mode=511): 106 head, tail = path.split(name) 107 if not tail: 108 head, tail = path.split(head) 109 if head and tail and not path.exists(head): 110 try: 111 makedirs(head, mode) 112 except OSError as e: 113 if e.errno != errno.EEXIST: 114 raise 115 116 if tail == curdir: 117 return 118 mkdir(name, mode)
41 def mkdir(path): 42 try: 43 os.makedirs(path) 44 return True 45 except OSError: 46 return False
39 def mkdir(*args, **kwargs): 40 """ 41 Create the specified directory. 42 Tolerant of race conditions. 43 44 :param args: path[, mode] that goes to os.makedirs 45 :param kwargs: path 46 :return: 47 """ 48 try: 49 os.makedirs(*args, **kwargs) 50 except OSError, e: 51 if e.errno != errno.EEXIST: 52 raise
88 def mkdir(self): 89 """make a directory on this path (including all needed intermediate directories), if this 90 path doesn't already exist""" 91 if not self.exists(): 92 os.makedirs(self.path)
65 def makedirs(dir): 66 """ 67 mkdir variant that does not complain when the dir already exists 68 """ 69 try: 70 os.makedirs(dir) 71 except OSError: 72 # directory probably exists 73 pass
50 def mkdirP(d): 51 try: 52 os.makedirs(d) 53 except OSError, err: 54 if err.errno != errno.EEXIST: 55 raise
18 def makedirs(dirname): 19 if not os.path.exists(dirname): 20 os.makedirs(dirname)
424 def mkdir(path,root=None,mode=None): 425 '''create a new directory in the root directory 426 427 create a directory at *path* and any necessary parents (i.e. ``mkdir -p``). 428 Default mode is read/write/execute for \'user\' and \'group\', and then 429 read/execute otherwise. 430 431 Args: 432 path (str): string name of the new directory. 433 root (str, default=None): path at which to build the new directory. 434 mode (str, default=None): octal read/write permission [default: 0o775]. 435 436 Returns: 437 string absolute path for new directory. 438 ''' 439 if mode is None: mode = MODE 440 if not root: root = os.curdir 441 newdir = os.path.join(root,path) 442 absdir = os.path.abspath(newdir) 443 import errno 444 try: 445 os.makedirs(absdir,mode) 446 return absdir 447 except OSError: 448 err = sys.exc_info()[0] 449 if (err.errno != errno.EEXIST) or (not os.path.isdir(absdir)): 450 raise