Chapter 11: File-System Interface
File Concept
File Structure
File Attributes
File Operations
File Types – name, extension

File Type Usual extension Function
Executable exe, com, bin, or none ready-to-run machine-language program
Object obj, o compiled machine language, not linked
Source code c, p, pas, f77, asm, cpp, java source code in various languages
Batch bat, sh commands to the command interpreter
Text txt, doc textual data documents
Word processor wp, tex, rtf, etc. various word-processor formats
Library lib, a libraries of routines
Print or view ps, dvi, jpg, gif ASCII or binary file
Archive zip, tar, arc related files grouped into one file, sometimes compressed

Access Methods
read next
write next
no read after last write rewrite)
read n
write n
position to n read next
write next
rewrite n
n = relative block number
Directory Structure
Information in a Device Directory
Operations Performed on Directory
Organize the Directory (Logically) to Obtain
Single-Level Directory
Two-Level Directory
Tree-Structured Directories
(Figure 11.9)


rm <file-name> mkdir <dir-name>

Example: if in current directory /spell/mail

mkdir count
Acyclic-Graph Directories

General Graph Directory
(Figure 11.11)


Access Lists and Groups
                       R W X
a) owner access 7  ==> 1 1 1

                       R W X
b) groups access 6 ==> 1 1 0

                       R W X
c) public access 1 ==> 0 0 1

File-System Structure
Contiguous Allocation
Linked Allocation

Indexed Allocation


(Figure 11.18)

Indexed Allocation – Mapping
Indexed Allocation – Mapping (Cont.)
Indexed Allocation – Mapping (Cont.)

Combined Scheme: UNIX (4K bytes per block)

Free-Space Management

Free-Space Management (Cont.)
block size = 212 bytes

disk size = 230 bytes (1 gigabyte)

n = 230/212 = 218 bits (or 32K bytes)

Free-Space Management (Cont.)
Directory Implementation
Efficiency and Performance
Various Disk-Caching Locations