Checks if a directory exists and if not, optionally creates it.
The directory path to check.
Optional input parameter, defaults to false.
Checks if a directory exists and if not, optionally creates it.