write a list of the pages to a file