added memory to file function

Added function to take a text from memory and a file path to create a
file.