{ } Raw JSON

bundles / IPython 9.17.0 / IPython / utils / path / ensure_dir_exists

function

IPython.utils.path:ensure_dir_exists

source: /dev/ipython/IPython/utils/path.py:345

Signature

def ensure_dir_exists(path: str, mode: int = 493)

Summary

ensure that a directory exists

Extended Summary

If it doesn't exist, try to create it and protect against a race condition if another process is doing the same.

The default permissions are 755, which differ from os.makedirs default of 777.

Aliases

  • IPython.paths.ensure_dir_exists