Write files to output directory