I would like to create a hierarchy of directories, if they do not exist.
For example; imagine the path /tmp/myfolder/myclients
If myfolder
exists, I can just use os.mkdir
to create myclients
folder, if it does not exist; but how do I create myfolder
too, in case it does not exist? Because os.mkdir
does trigger an error if I try to create myclients inside myfolder, if myfolder does not exist
Should I make a call for each folder that is nested and create folders as I go, or there is a more efficient way to do this?