Added file operations for writing to a file.