Add an array to keep track of file-to-slice mapping when writing.