2. Lecture Contents
Lecture 1: File Management System Overview
Lecture 2: File Organization and Access
Lecture 3: B-Tree and File Directories
Lecture 4: File Sharing and Record Blocking
Lecture 5: File Allocation and Methods
Lecture 6: Free Space Management
FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
3. Lecture 4: File Sharing and Record Blocking
FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
File Sharing
Access Rights
Simultaneous Access
Record Blocking
4. Learning Objectives
FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
To describe the requirements for file sharing.
To explain the concept of record blocking.
5. FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
In a multiuser system, there is almost always a requirement for allowing files to be
shared among a number of users.
When file sharing among users, two cases appear:
Access Rights
Management of simultaneous access
File Sharing
6. FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
Access Rights
The file system should provide a flexible tool for allowing extensive file sharing
among users.
The following are access rights that can be assigned to a particular user for a
particular file.
None: The user would not be allowed to read the user directory that includes
the file.
Knowledge: The user can determine that the file exists and who its owner is.
Execution: The user can load and execute a program but cannot copy it.
7. FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
Access Rights
Reading: The user can read the file for any purpose, including copying and
execution.
Appending: The user can add data to the file but cannot modify or delete any of
the file’s contents.
Updating: The user can modify, delete, and add to the file’s data.
Changing protection: The user can change the access rights granted to other
users.
Deletion: The user can delete the file from the file system.
8. FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
Access Rights
Owner
Usually the initial
creator of the file
Has full rights
May grant rights
to others
Specific Users
Individual
users who are
designated by
user ID
User Groups
A set of users
who are not
individually
defined.
All
All users who
have access to
this system
These are public
files
Access can be provided to different classes of users.
9. FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
Simultaneous Access
When access is granted to append or update a file to more than one user, the
operating system or file management system must enforce discipline.
A brute-force approach is to allow a user to lock the entire file when it is to be
updated.
A finer grain of control is to lock individual records during update.
10. FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
Record Blocking
Blocks are unit of I/O with secondary storage.
For I/O to be performed, records must be organized as blocks.
Given the size of block, there are three methods of blocking that can be used;
Fixed-Length Blocking : fixed-length records are used, and an integral number of
records (or bytes) are stored in a block.
Internal fragmentation – unused space at the end of each block.
Variable-Length Spanned Blocking : variable-length records are used and are packed
into blocks with no unused space.
Variable-Length Unspanned Blocking : variable-length records are used, but spanning
is not employed.
11. FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
Record Blocking
R2 R3 R4 Track 1
R1
R6 R7 R8 Track 2
R5
Fixed blocking
R3 R4 R6 Track 1
R1
R8 R9 R13 Track 2
R6
Variable blocking: spanned
R2 R4 R5
R7 R9 R10 R11 R12
R2 R4 R5 Track 1
R1
R7 R8 R10 Track 2
R6
R3
R9
Data Gaps due to hardware design
Waste due to block fit to track size
Waste due to record fit to block size
Waste due block size constraint from fixed record size
Figure 12.8. Record
Blocking Methods
12. FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
Summary
In this lecture, you learned about
File sharing in which access rights and access that can be provided to different
classes of users.
Three types of record blockings.
13. Learning Outcomes
FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
After the end of the lecture, the students will be able to:
understand access rights that permit to access or deny a file or a directory.
know access rights that can be provided to the different class of users.
recognize that how to use three methods of blocking depending on the size of the
record blocks.
14. References
FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
1. “Operating Systems, internal and Design Principles” by William Stallings, 7th
Edition, ISBN 13: 978-13-230998-1.