Principle of FAT file system 3
4.3 FAT tables and data storage principles. Table FAT (File Allocation Table file allocation table), is a chain structure for Microsoft Disk data (files) indexing and positioning the introduction of the FAT file system. If the disk compared to a book, FAT table book can be considered equivalent to a directory, and the file is the content of each chapter. But representation FAT tables and directories, but are very different. ★ stored procedure hypothetical: We then consider how to write these three files directory. For each document, must be recorded are: file name, starting cluster, size, creation date, time, modification date, time, file read and write attributes. Here ends the cluster size can not be used to calculate it? Must not, because the file size is not necessarily an integer number of cluster size, then is the content as the content of 54KB B.TXT Otherwise, the less of course not, may be more is not enough. So how do we record it? Imagine. In order to facilitate the management, we use a database management to manage our directory. So I 1KB further divided into 10 parts, assuming starting cluster number is 0, define the meaning of each representative of each location is shown in Figure 4.3.2 100B Such a structure can definitely designed for reading and writing files correctly. Then let us design a file system to work. First alter files, such as A.TXT, increase the point content! Huh? Where to put the increase in the country, although the back of the memory block has a lot of space, but followed B.TXT data also wore it? If the A.TXT moved behind a waste processing resources, and does not necessarily solve the problem. It seems to temporarily solve the problem. This operation also appears to be, then we do, in a file stored in D.txt (size 60.3KB), a total of 100 clusters in space only 31 clusters, as well as the remaining 68 clusters, supposedly able to put down. But? Where to put it? No 61 contiguous space, catalog no way to write a line, it seems that non-contiguous blocks stored temporarily not OK. It seems that we designed file system has a fatal flaw, how to solve it? . . . . In fact, it can be solved: |