VI 2 File Syst Interf
VI 2 File Syst Interf
File Concept
Access Methods
Directory Structure
File System Mounting
File Sharing
Protection
11.1
File Concept
Contiguous logical address space
Types:
Data
numeric
character
binary
Program
11.2
File Structure
None - sequence of words, bytes
Simple record structure
Lines
Fixed length
Variable length
Complex Structures
Formatted document
Relocatable load file
control characters
Who decides:
Operating system
Program
11.3
File Attributes
Name only information kept in human-readable form
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,
11.4
File Operations
Create
Write
Read
file seek reposition within file
Delete
Truncate
Open(Fi) search the directory structure on disk for entry Fi, and
structure on disk
11.5
Open Files
Several pieces of data are needed to manage open files:
File pointer: pointer to last read/write location, per process that has
11.6
requested
do
11.7
11.8
11.9
11.10
Access Methods
Sequential Access
Direct Access
read next
write next
reset
no read after last write
(rewrite)
read n
write n
position to n
read next
write next
rewrite n
11.11
Sequential-access File
11.12
11.13
11.14
Directory Structure
A collection of nodes containing information about all files
Directory
Files
F1
F2
F3
F4
Fn
11.15
11.16
11.17
11.18
11.19
Single-Level Directory
A single directory for all users
Naming problem
Grouping problem
11.20
Two-Level Directory
Separate directory for each user
Path name
Can have the same file name for different user
Efficient searching
No grouping capability
11.21
Tree-Structured Directories
11.22
11.23
rm <file-name>
Creating a new subdirectory is done in current directory
mkdir <dir-name>
11.24
Acyclic-Graph Directories
Have shared subdirectories and files
11.25
Solutions:
Backpointers, so we can delete all pointers
11.26
11.27
11.28
accessed
11.29
11.30
Mount Point
11.31
File Sharing
Sharing of files on multi-user systems is desirable
Sharing may be done through a protection scheme
On distributed systems, files may be shared across a network
Network File System (NFS) is a common distributed file-sharing
method
11.32
protections to be per-user
access rights
11.33
from servers
11.34
11.35
semantics
concurrently
11.36
Protection
File owner/creator should be able to control:
what can be done
by whom
Types of access
Read
Write
Execute
Append
Delete
List
11.37
RWX
a) owner access
RWX
b) group access
RWX
c) public access
111
110
001
appropriate access.
owner
chmod
group
761
public
game
G
11.38
game
Silberschatz, Galvin and Gagne 2003