Summary of basic concepts of file system

1---

        filesystem = file + directory structure;

2---

         From the user's point of view, a file is the smallest allocation unit of logical external memory, that is, data cannot be written to external memory unless it is in a file. Files represent programs (source and target forms) and data.

3---

Files have a certain structure based on their type

4---

File Properties: Name, Location, Size, Protection, Identifier, Type, Time, Date, User ID. Place

All file information is stored in the directory structure, and the directory structure is also stored in the external memory . On systems with many files, the directory itself can be several MB in size. Because directories, like files, must also be non-volatile, so they must be placed on the device and loaded into memory several times when needed.

5----

File operation = " File is an abstract data type.

Open or close a file :---The vast majority of file operations involve searching for relevant directory entries for a given file. To avoid this constant search operation, many systems require that when a file is used for the first time,Use the system call open(). The operating system maintains an information table containing all open files -------- open file table. When a file operation is required, the file can be specified through an index of the table without searching. when the textA file can be closed by a process when it is no longer in use, and the operating system deletes this entry from the information table of open files.

6----

Each open file has the following information: file pointer, file open calculator (when the number is 0, the file can be closed, that is, when many processes open the same file, you need to wait for the last process to close the file), file disk location, Access permissions (each process opens the file with an access mode. This information is kept in the individual process open file table so that the operating system can deny or allow future I/O operations.

7----

File types: When designing a file system, always consider whether file types should be recognized and supported. If the operating system recognizes the file type, then it can operate on the file in a reasonable way.

8---

File types can also be used to represent the internal structure of a file, for example, source and object files have a certain structure to suit the requirements of the corresponding handler, and some files must conform to the structure required by the operating system. for example: an operating system might require the executable to have a specific structure so that it can determine where to load the file and where the first instruction is.

9----

File lock: to be recorded. . . .

10---

File access methods: sequential access, direct access, other access methods.

11----

Directory Structure: Storage Structure:

A disk can be used as a whole for a file system, however, sometimes it is necessary to install multiple file systems on a disk or one part is used for the file system and another part is used elsewhere, such as swap space or unformatted disk space, these parts are called. for partitions, slices, etc. One file system can be created per disk partition. These parts can be combined into a larger structure that can be called a volume, or a file system can be created on it, for simplicity - a large block of storage space where the file system is stored can be used as a volume, and the volume can hold multiple operating systems, making The system boots and runs multiple operating systems.

12----

A hard disk has multiple partitions, and a partition may span multiple hard disks.

13---

File sharing and protection: user ids: identifies the user identity, and can set access permissions and protection levels for specified users.

group ids: You can set access permissions in groups.

          Protect:

                                        The file owner/creator has the right to decide: who can manipulate the file and what can be done with the file.

3 types of users:

     File owner Example: RWX/111

     User in the same group RWX/110

     General user            RWX/001

               The project manager creates a group: the group name is D, and then adds users to this group.

      For a file (game) or subdirectory, define its access permission: hang the file game in the D group---->chgrp D game.(linux )



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325529115&siteId=291194637