CH 9 Kiit
CH 9 Kiit
CH 9 Kiit
Types:
Data
numeric
character
binary
Program
File Attributes
Name – only information kept in human-readable form
Identifier – unique tag (number) identifies file within file system
Type – needed for systems that support different types
Location – pointer to file location on device
Size – current file size
Protection – controls who can do reading, writing, executing
Time, date, and user identification – data for protection, security,
and usage monitoring
Information about files are kept in the directory structure, which is
maintained on the disk
File Operations
File is an abstract data type
Create
Write
Read
Reposition within file
Delete
Truncate
Open(Fi) – search the directory structure on disk for entry Fi, and
move the content of entry to memory
Close (Fi) – move the content of entry Fi in memory to directory
structure on disk
Access Methods
Sequential Access
read next
write next
reset
no read after last write
(rewrite)
Direct Access
read n
write n
position to n
read next
write next
rewrite n
n = relative block number
Directory Structure
Directory
Files
F1 F2 F4
F3
Fn
Naming problem
Grouping problem
Two-Level Directory
Separate directory for each user
Path name
Can have the same file name for different user
Efficient searching
No grouping capability
Tree-Structured Directories
General Graph Directory
(a) Existing. (b) Unmounted Partition
Mount Point
Protection
File owner/creator should be able to control:
what can be done
by whom
Types of access
Read
Write
Execute
Append
Delete
List
Access Lists and Groups
Mode of access: read, write, execute
Three classes of users
RWX
a) owner access 7 111
RWX
b) group access 6 110
RWX
c) public access 1 001
Ask manager to create a group (unique name), say G, and add some users to
the group.
For a particular file (say game) or subdirectory, define an appropriate access.
Contiguous allocation
Linked allocation
Indexed allocation
Contiguous Allocation of Disk Space
Linked Allocation
6 5
1
File-Allocation Table
Example of Indexed Allocation
Indexed Allocation – Mapping (Cont.)
outer-index