Académique Documents
Professionnel Documents
Culture Documents
File Systems
10.1 Basic Functions of File Management
10.2 Hierarchical Model of a File System
10.3 Users View of Files
Logical File Organization
Operations on Files
10.4 File Directories
Hierarchical Organizations
Operations on Directories
Implementation
10.5 Basic File System
Opening and Closing of Files
10.6 Physical Organization Methods
Contiguous, Linked, Indexed Organization
Management of Free Storage Space
Operating Systems
Operating Systems
Hierarchical Model of FS
Directory management:
map logical name to
unique Id, file descriptor
Basic file system:
open/close files
Operating Systems
Operating Systems
Operations on Files
Create/Delete
Open/Close
Read/Write (sequential or direct)
Seek/Rewind (sequential)
Copy (physical or just link)
Rename
Change protection
Get properties
Operating Systems
Operations on Files
Operating Systems
Directory Management
Directory: hierarchical structure to keep track of files
Main issues:
Shape of data
structure (e.g.
tree, shortcuts, )
What info to keep
about files
Where to keep it?
(in directory?)
How to organize
entries for
efficiency?
Operating Systems
File Directories
Tree-structured
Simple search, insert,
delete operations
Sharing is asymmetric
(only one parent)
Operating Systems
10
File Directories
DAG-structured
Symmetric sharing,
but
11
File Directories
DAG-structured
Allow cycles?
12
File Directories
Symbolic links (shortcuts)
Compromise to allow
sharing but avoid
cycles
13
File Directories
How to uniquely name a file in the hierarchy?
Path names
Concatenated local names with delimiter:
( . or / or \ )
Absolute path name: start with root
(/)
Relative path name: Start with current directory
(.)
Notation to move upward in hierarchy
(..)
Operating Systems
14
Practice navigation
Operating Systems
15
Operating Systems
16
Implementation of Directories
What information to keep in each entry
All descriptive information
Directory can become very large
Searches are difficult/slow
Only symbolic name and pointer to descriptor
Needs an extra disk access to descriptor
Variable name length?
Example: BFS
Operating Systems
17
Implementation of Directories
How to organize entries
within directory
Fixed-size entries:
use array of slots
Variable-size entries:
use linked list (like BFS)
Size of directory:
fixed or expanding
Example: Windows 2000
when # of entries
exceeds directory size,
expand using B+-trees
Operating Systems
18
19
Operating Systems
20
21
Operating Systems
22
23
24
Operating Systems
25
Simple implementation
Fast sequential access (minimal arm movement)
Insert/delete is difficult
How much space to allocate initially
External fragmentation
Operating Systems
26
Operating Systems
27
Operating Systems
28
Insert/delete is easy
Sequential and direct access is efficient
Drawback: file size limited by number of index entries
Operating Systems
29
Operating Systems
30
Operating Systems
31
Operating Systems
32