CS3224 - 6. Files (three per page)

CS3224 - 6. Files (three per page) - Chapter 6 File Systems...

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

View Full Document Right Arrow Icon
1 1 File Systems Chapter 6 6.1 Files 6.2 Directories 6.3 File system implementation 6.4 Example file systems 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-32, ntfs, nfs, ext2 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
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 4 File Naming Typical file extensions. 5 File Structure • Three kinds of files byte sequence record sequence tree 6 Sample Files (a) An executable file (b) An archive
Background image of page 2
3 7 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 8 File Attributes Possible file attributes 9 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 3

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

View Full DocumentRight Arrow Icon
4 10 An Example Program Using File System Calls (1/2) 11 An Example Program Using File System Calls (2/2) 12 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
Background image of page 4
5 13 Directories Single-Level Directory Systems • A single level directory system contains 4 files owned by 3 different people, A, B, and C 14 Two-level Directory Systems Letters indicate owners of the directories and files 15 Hierarchical Directory Systems A hierarchical directory system
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 16 Directory Operations 1. Create 2. Delete 3. Opendir 4. Closedir 5. Readdir 6. Rename 7. Link 8. Unlink 17 File System Implementation A possible file system layout 18 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
Background image of page 6
7 19 Implementing Files (2) Storing a file as a linked list of disk blocks 20 Implementing Files (3) File Allocation Table (FAT) uses a linked list in memory 21 Implementing Files (4) Combination of Direct and Indirect Block Pointers Simplified version of Unix i-node
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 22 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 23 Implementing Directories (2) • Two ways of handling long file names in directory (a) In-line (b) In a heap 24 Linking (1) File system containing a file that is “shared” between two directories
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 24

CS3224 - 6. Files (three per page) - Chapter 6 File Systems...

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

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