File directory concept and file physical structure

First, continuous documents:

  1. Sequence file:

The files on the disk are continuously stored according to the physical structure, and the number of blocks (1 block 4 kb) is determined according to the size of each file. And then find consecutive ones on the disk

Space, continue to store files at the back of the file, we only need to go to a fixed track on a fixed cylinder to find continuous files, only the head movement is needed

It can be accessed with a short distance. This access speed block is easy to access, but we know that the disk is a mechanical movement and takes a long time.

And read and write is random, we want to write to the specified location, we must first find this address. When files on the disk are deleted, it is necessary to defrag the disk

Too much overhead. Therefore, the management of such files has a certain price.

  1. Connection file:

① Implicit connection: Each file stores a pointer to the next file, so that we can find the data we need according to the pointer. But the disadvantages of this method

end. When we access a file, we need to access the file from the beginning, and then link to this file, we need to load many unnecessary files

Address to memory, resulting in wasted performance.

② Show connection: This method is an improvement on the implicit link above. We take all the file pointers to the next file and put them in a special purpose.

To store the file pointing to the next address. This table is called the file allocation table (Fat). We only need to access the corresponding file location of this table to get

扫描二维码关注公众号,回复: 9060752 查看本文章

To the file’s memory. Greatly improved the efficiency of retrieval. Windows and DOS operating systems both use this display connection.

③ Index file: We create an index block for each file, and the index information of each file is recorded in the index block, so that we can

To find the actual physical address corresponding to the file. When our index file is full, there will be an index block that is the same as the index block.

To record the remaining index blocks, and then use an index block to record the positions of the two index blocks, so that the effect of the secondary index is achieved. And so on, I

We can achieve the effect of multi-level indexing. As for the consideration of the organizational structure of multi-level indexes, data structures such as b-tree, b + -tree, red-black tree, etc.

Greatly improve the efficiency of retrieval.

④ NTFS file system: This system is a recoverable and efficient file management system developed by Microsoft Corporation. The disk organization of this system is

The basic unit for distribution and recycling. The size of a cluster is an integer power of 2, but the size of a cluster is generally 4k, which is consistent with the size of our memory allocation block. In this system, the files on the disk are all in the form of files. The characteristics of this system are security, and the data protection is well done.

发布了13 篇原创文章 · 获赞 2 · 访问量 1044

猜你喜欢

转载自blog.csdn.net/weixin_44033021/article/details/104055898