File management of the operating system: 6. Basic file operations (create files, open files, delete files, close files, read files, write files)

mind Mapping

Insert picture description here

File operations

Create a file

Insert picture description here

Delete Files

Insert picture description here

Read file

Insert picture description here

Write file

Insert picture description here

open a file

Insert picture description here
Insert picture description here

1. There is a system file open table in the system, which is used to manage all open files.
2. There is a process file open table in the process, which is used to manage the files opened by the process.
3. When the open file open command is executed , The operating system will query the file directory table under the path given by the user, find the FCB from the table, and copy the FCB to the file open table of the system (if there are other processes open, just click the open counter +1 directly ) Is also copied to the open file table of the process
4. After the open command is executed, the data of the file will not be written to the memory, just the operation of several tables

Close file

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_41587740/article/details/109058741