Writes page to file.