CS3224 - 4. Files

CS3224 - 4. Files - File Systems Chapter 4 1 What do we...

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
1 File Systems Chapter 4 1 2 What do we need to know? How are files viewed on different OS’s? What is a file system from the programmer’s viewpoint? You mostly know this, but we’ll review the main points. How are file systems put together? How is the disk laid out for directories? For files? What kind of memory structures are needed? What do some real file systems look like? cp/m, ms-dos (fat-12/16/32), ntfs, nfs, ext2, … What directions are file systems going?
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 3 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 4 File Naming Issues • Character Set • Length • Extensions
Background image of page 2
3 5 File Naming Typical file extensions. 6 File Structure There are lots of files types. Here are three: byte sequence, record sequence, tree
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 7 Sample Files (a) An executable file (b) An archive 8 File Access • Sequential access read all bytes/records from the beginning cannot jump around, could rewind or back up convenient when medium was mag 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
Background image of page 4
5 9 File Attributes Possible file attributes 10 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
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 11 An Example Program Using Unix File System Calls (1/2) 12 An Example Program Using File System Calls (2/2)
Background image of page 6
7 13 Memory-Mapped Files (a) Segmented process before mapping files into its address space (b) Process after mapping existing file abc into one segment creating new segment for xyz 14 Directories Single-Level Directory Systems • A single level directory system contains 4 files owned by 3 different people, A, B, and C
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 15 Two-level Directory Systems Letters indicate owners of the directories and files 16 Hierarchical Directory Systems A hierarchical directory system
Background image of page 8
9 17 Directory Operations 1. Create 2. Delete 3. Opendir 4. Closedir 5. Readdir 6. Rename 7. Link 8. Unlink 18 File System Implementation A possible file system layout
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
10 19 Implementing Files (1) (a) Contiguous allocation of disk space for 7 files (b) State of the disk after files D and E have been removed 20 Implementing Files (2) Storing a file as a linked list of disk blocks
Background image of page 10
11 21 Implementing Files (3) File Allocation Table (FAT) uses a linked list in memory 22 Implementing Files (4) Combination of Direct and Indirect Block Pointers Note: This is a simplified version of Unix i-node
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
12 23 The UNIX V7 File System A UNIX i-node 24 Implementing Directories (1) (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
Background image of page 12
13 25 Implementing Directories (2) • Two ways of handling long file names in directory
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 36

CS3224 - 4. Files - File Systems Chapter 4 1 What do we...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online