You are viewing an older version (9.10.0). Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.10.0 / IPython / core / profiledir / ProfileDir / _mkdir

function

IPython.core.profiledir:ProfileDir._mkdir

source: /IPython/core/profiledir.py :74

Signature

def   _mkdir ( self path : str mode : Optional[int] = None )  →  bool

Summary

ensure a directory exists at a given path

Extended Summary

This is a version of os.mkdir, with the following differences:

  • returns whether the directory has been created or not.

  • ignores EEXIST, protecting against race conditions where the dir may have been created in between the check and the creation

  • sets permissions if requested and the dir already exists

Parameters

path: str

path of the dir to create

mode: int

see mode of os.mkdir

Returns

: bool:

returns True if it created the directory, False otherwise

Aliases

  • IPython.core.application.ProfileDir._mkdir