






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







2
4
Sequential access: bytes of file are read in order from start to finish Reading a file from start to end e.g., cat program.c Random access: bytes of file are read in some (random) order e.g., Query to a database file
5
7
Question: How does the OS keep track of which disk blocks are associated with a given file? Consider a file that is 10 disk blocks in size File Descriptor: OS structure that describes which blocks on disk represent a file Issues:
8
File is stored in contiguous blocks on disk File descriptor: first block address, file size 17 20 94 99 File 1: Size 4 blocks; Blocks 17, 18, 19, 20 File 2: Size 6 blocks; Blocks 94, 95, 96, 97, 98, 99 File 1: Start 17 Size 4 File 2: Start 94 Size 6
10
File Index is an array containing addresses of 1 st , 2 nd , etc block of file File descriptor: index File 1: Size 4 blocks; Blocks 17, 84, 14, 99 14 17 84 99 17 84 14 99 1 2 3 4 INDEX Problem: size of the index?
11
1 2 3 4 5 6 7 8 9 10 11 12 Disk block addresses of file Indirect disk block address Doubly indirect disk block address Triply indirect disk block address Assume disk block size: 1KB, disk block address size: 4B 9KB + 256KB