Updated version; added feature to allow for automatic creation of files or directories if not already present