Added a function to create parent file if they dont exist
added a function to create parent directories if they do not exist