Use with statement when writing to file_path.