Professional Documents
Culture Documents
Systems
Lecture 42
Syed Mansoor Sarwar
Agenda for Today
Review of the previous lecture
File Concept
File Types
File Operations
Access Methods
Directories
Directory Operations
Directory Structure
14 September 2019 © Copyright Virtual University of
Pakistan
Review of Lecture 41
Thrashing
The Working Set Model
Page Fault Frequency Model
Other Considerations
Prepaging
Page size
Program structure
Examples
14 September 2019 © Copyright Virtual University of
Pakistan
The File Concept
Contiguous logical address
space
Types:
Data
Numeric
Character
Binary
Program
14 September 2019 © Copyright Virtual University of
Pakistan
File Structure
None - sequence of words, bytes
Simple record structure
Lines
Fixed length
Variable length
Complex Structures
Formatted document
Relocatable load file
14 September 2019 © Copyright Virtual University of
Pakistan
File Structure
Who decides?
Operating system
DOS/Windows
.exe, .com, .bat, …
Program
UNIX/Linux
UNIX/Linux
Directory
Files and F1 F2 F4 Fn
F3
Directories
14 September 2019 © Copyright Virtual University of
Pakistan
Directory Operations
Create — mkdir
Open — opendir
Read — readdir
Rewind — rewinddir
Close — closedir
Delete — rmdir
Change Directory — cd
List — ls
Search
14 September 2019 © Copyright Virtual University of
Pakistan
Directory Structure
Efficient
Searching
Naming – convenient to users
Two users can have same name
for different files
The same file can have several
different names
Grouping – logical grouping of
files by properties, (e.g., all Java
programs, all games, …)
14 September 2019 © Copyright Virtual University of
Pakistan
Single-Level Directory
A single directory for all users.
Naming problem
Grouping problem
14 September 2019 © Copyright Virtual University of
Pakistan
Two-Level Directory
Separate directory for each user
Path name
Can have the same file name for different user
Efficient searching
No grouping
14 September 2019 capability
© Copyright Virtual University of
Pakistan
Tree Directory