* Create the directory if it does not exist and check permissions