5.1.1.10. mkdir_p

mfutil.mkdir_p(path, nodebug=False, nowarning=False)[source]

Make a directory recursively (clone of mkdir -p).

Thanks to http://stackoverflow.com/questions/600268/
mkdir-p-functionality-in-python .

Any exceptions are catched and a warning message is logged in case of problems.

If the directory already exists, True is returned with no debug or warning.

Parameters:
  • path (string) – complete path to create.
  • nodebug (boolean) – if True, no debug messages are logged.
  • nowarning (boolean) – if True, no message are logged in case of problems.
Returns:

True if the directory exists at the end.

Return type:

boolean