Download presentation
Presentation is loading. Please wait.
Published byDylan Wilkinson Modified over 9 years ago
1
4061 Session 12 (2/22)
2
Today Files and Directories
3
Today’s Objectives Describe the contents/function of: –inode –directory file –symbolic link file Calculate the available storage of an inode, given storage parameters Trace how an operating system locates the data for a file, given a path name Describe the difference between soft and hard links Become familiar with some c functions for managing files
4
Admin Homework Due Tomorrow Quizzes back Monday
5
Disk Organization Disk organized into partitions –In Windows, think of this as the c:, d: drives –In UNIX, less obvious, but still present Each partition can have its own file system –Many different file systems exist: Windows uses NTFS, Linux often uses ext3 (In UNIX) each file system can be mounted by another file system
6
File System Organization
7
What Are Inodes? Data for a particular file on a hard disk are scattered –Where data goes depends on OS and use of the system We use inodes to give us a logical picture of the file –a sequence of bytes with a beginning and an end
8
More about Inodes stat() looks at the inode for information inodes are looked up in a filesystem by number –Table of inodes –/ is usually inode 2 (see “stat /”)
10
Exercise Robbins pg. 159: 5.11 Information about inode: –128 bytes, status takes 68 bytes –block size 8 kilobytes –pointers 4 bytes How big of a file can we access with direct pointers? With a single/double/triple indirect pointer?
11
Inodes Trade-offs: direct vs. indirect pointers Strengths of inodes? Weaknesses of inodes?
12
Directories Yep, an inode But the data is structured
13
Directory Example
14
Hard Links A hard link occurs when two directories refer to the same inode
15
Symbolic (Soft) Links A file whose data blocks contain a path name
16
Creating Links in Unix ln [OPTION]... TARGET [LINK_NAME] -s, --symbolic –make symbolic links instead of hard links
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.