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)