Presentation is loading. Please wait.

Presentation is loading. Please wait.

File Systems Topics –File –Directory –File System Implementation Reference: Chapter 5: File Systems Operating Systems Design and Implementation (Second.

Similar presentations


Presentation on theme: "File Systems Topics –File –Directory –File System Implementation Reference: Chapter 5: File Systems Operating Systems Design and Implementation (Second."— Presentation transcript:

1 File Systems Topics –File –Directory –File System Implementation Reference: Chapter 5: File Systems Operating Systems Design and Implementation (Second Edition) by Andrew S. Tanenbaum, Albert S. Woodhull

2 File: Long-term Information Storage 1.Must store large amounts of data 2.Information stored must survive the termination of the process using it 3.Multiple processes must be able to access the information concurrently

3 File Naming Typical file extensions.

4 File Structure Three kinds of files –byte sequence –record sequence –tree

5 File Access Sequential access –read all bytes/records from the beginning –cannot jump around, could rewind or back up –convenient when medium was magnetic tape Random access –bytes/records read in any order –essential for data base systems –read can be move file marker (seek), then read or read and then move file marker

6 File Attributes Possible file attributes

7 File Operations 1.Create 2.Delete 3.Open 4.Close 5.Read 6.Write 7.Append 8.Seek 9.Get attributes 10.Set Attributes 11.Rename

8 A UNIX directory tree Path Names

9 Directory Operations 1.Create 2.Delete 3.Opendir 4.Closedir 5.Readdir 6.Rename 7.Link 8.Unlink

10 File System Implementation Contiguous Allocation Linked List Allocation Linked List Allocation using Index –FAT used by WINDOWS I-nodes –Used by UNIX

11 Contiguous Allocation (a) Contiguous allocation of disk space for 7 files (b) State of the disk after files D and E have been removed Drawback Have to know maximum size of the file while creation Fragmentation

12 Linked List Allocation Storing a file as a linked list of disk blocks Advantage No fragmentation (except internal fragmentation) Drawback Random access is slow

13 Linked List Allocation using Index Linked list allocation using a file allocation table in RAM Fast Random Access

14 I-node A UNIX i-node

15 Implementing Directories (a) A simple directory fixed size entries disk addresses and attributes in directory entry (b) Directory in which each entry just refers to an i-node

16 MS-DOS Directory Entry The MS-DOS directory entry

17 The UNIX Directory Entry A UNIX V7 directory entry

18 Looking up for an entry The steps in looking up /usr/ast/mbox


Download ppt "File Systems Topics –File –Directory –File System Implementation Reference: Chapter 5: File Systems Operating Systems Design and Implementation (Second."

Similar presentations


Ads by Google