0% found this document useful (0 votes)
12 views22 pages

Chapter 04

Uploaded by

Mohammed Ibrahim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views22 pages

Chapter 04

Uploaded by

Mohammed Ibrahim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Chapter 4 File Systems

File Systems
(1)
Essential requirements for long-
term information storage:

• It must be possible to store a very large


amount of information.
• The information must survive the
termination of the process using it.
• Multiple processes must be able to
access the information concurrently.
File Systems
(2)
Think of a disk as a linear sequence of
fixed-size blocks and supporting
reading and writing of blocks.
Questions that quickly arise:

• How do you find information?


• How do you keep one user from reading
another’s data?
• How do you know which blocks are free?
File
Naming

Figure 4-1. Some typical file


extensions.
File
Structure

Figure 4-2. Three kinds of files. (a) Byte


sequence.
(b) Record sequence. (c) Tree.
File
Types

Figure 4-3. (a) An executable file. (b) An


archive.
File
Attributes

Figure 4-4a. Some possible file


attributes.
File
Operations
The most common system calls relating
to files:
• Creat • Append
e • Seek
• Delet • Get
e Attributes
• Open • Set
• Close Attributes
• Read • Rename
• Write
Example Program Using File System
Calls (1)

...
Figure 4-5. A simple program to copy
a file.
Example Program Using File System
Calls (2)

Figure 4-5. A simple program to copy


a file.
Hierarchical Directory
Systems (1)

Figure 4-6. A single-level directory system containing


four files.
Hierarchical Directory
Systems (2)

Figure 4-7. A hierarchical directory


system.
Path
Names

Figure 4-8. A UNIX directory


tree.
Directory
Operations
System calls for managing
directories:
• Create • Readdi
• Delete r
• Opendi • Renam
r e
• Closedi • Link
r • Uplink
File System
Layout

Figure 4-9. A possible file system


layout.
Journaling File
Systems
Operations required to remove a file in UNIX:

• Remove the file from its directory.


• Release the i-node to the pool of free i-nodes.
• Return all the disk blocks to the pool of free disk
blocks.
The MS-DOS File System
(1)

Figure 4-31. The MS-DOS directory


entry.
The MS-DOS File System
(2)

Figure 4-32. Maximum partition size for different block


sizes. The empty boxes represent forbidden
combinations.
The UNIX V7 File System
(1)

Figure 4-33. A UNIX V7 directory


entry.
The UNIX V7 File System
(2)

Figure 4-34. A UNIX i-


node.
The UNIX V7 File System
(3)

Figure 4-35. The steps in looking up


/usr/ast/mbox.
END

You might also like