In the invention it is assumed that in a data recording operation, when
the data recording is initiated, the data recording module writes the
initial value of the file size in the new file attribute area of the
directory, and when the data recording is ended, the data recording
module writes the number of clusters as the file size in the new file
attribute area. With this assumption, the FAT restoration module examines
the file size written in the file attribute area, and distinguishes the
first file for which the writing is normally terminated, from the second
file for which the writing is not normally terminated. The FAT
restoration module tracks the FAT chain of the first file and stores the
file number of the first file in the map area corresponding to that FAT.
Thereafter, the FAT restoration module tracks the FAT chain of the second
file, and stores the file number of the second file in the map area
corresponding to that FAT. Therefore, at the least, FATs corresponding to
clusters in which data may have been recorded can be designated on the
FAT map, and the FAT map can be employed to restore the FAT of the
defective file.