Changed the outputting of files to use memory mapped files