rebuild the file struct