[Operating system] 05. File management

file management

image.png

file properties

image.png

Organization of data inside the file

image.png

image.png

image.png

organization between files

image.png

The operating system provides functionality to upper layers

image.png

image.png

image.png

  • Create a file
    image.png

  • Delete Files
    image.png

  • open a file
    image.png
    image.png

  • close file

image.png

  • read file

image.png

  • write file

image.png

Logical structure of the file

image.png

image.png

unstructured file

image.png

have structured files

image.png

sequence file

image.png

image.png

The physical structure of the file

image.png
image.png

disk block (file block)

image.png

image.png

image.png

continuous allocation

  • advantage
    image.png

For HDD
image.png

  • shortcoming
    image.png
    image.png

Summarize
image.png

link assignment

implicit link

image.png

image.png

image.png

explicit link

image.png

image.png

Summarize
image.png

index allocation

image.png

image.png

link scheme

image.png

multi-level index

image.png

mixed index

image.png

Summarize
image.png

File Directory

Requirements for directory management

  • Realize "access by name"
  • Improve catalog retrieval speed
  • File Sharing
  • Allow file renaming

Implementation of the file directory

FCB

Each file corresponds to a file control block (FCB)
A series of file control blocks constitute the file directory

Information contained in an FCB

  • Basic information: file name, physical location, logical structure, physical structure
  • Access control information: access rights, etc.
  • Usage information: creation modification date, etc.

image.png

index node

FCB no longer stores all information, only file names and index nodes are stored to reduce the size of FCB

Other information about the file is stored in the index node

image.png

image.png

Structure of the file directory

Single-stage

**image.png

two levels

image.png

multilevel (tree)

image.png
image.png
image.png

File Sharing

image.png

image.png

Based on inodes (hard links)

image.png

Based on symbolic links (soft links)

image.png

file protection

image.png

password protection

image.png

encrypted protection

image.png

Advantages: Strong confidentiality, no need to store "passwords" in the system
Disadvantages: Encoding/decoding, or encryption/decryption takes a certain amount of time.

Access control

image.png

image.png

Guess you like

Origin blog.csdn.net/weixin_50799082/article/details/130950441