Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

CH 9 Kiit

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 28

File-System Interface

Mr. SUBHASIS DASH


SCHOOL OF COMPUTER ENGINEERING.
KIIT UNIVERSITY
BHUBANESWAR
File Concept
 Contiguous logical address space

 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

 A collection of nodes containing information about all files

Directory

Files
F1 F2 F4
F3
Fn

Both the directory structure and the files reside on disk


Backups of these two structures are kept on tapes
Operations Performed on Directory
 Search for a file
 Create a file
 Delete a file
 List a directory
 Rename a file
 Traverse the file system
Single-Level Directory

 A single directory for all users

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.

owner group public

chmod 761 game

Attach a group to a file


chgrp G game
End of Chapter
File System
Implementation
Mr. SUBHASIS DASH
SCHOLE OF COMPUTER ENGINEERING.
KIIT UNIVERSITY
BHUBANESWAR
Layered File System
A Typical File Control Block

(Access control list)


Allocation Methods
 An allocation method refers to how disk blocks are allocated for
files:

 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

index table file


Combined Scheme: UNIX (4K bytes per block)
Linked Free Space List on Disk
End of Chapter

You might also like