Sort the files before writing them out.