Chapter (12)
File Management
Dr. Hnin Lai Nyo
Lecturer
Faculty of Computer Science
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
Lecture 4: File Sharing and Record Blocking
FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
File Sharing
Access Rights
Simultaneous Access
Record Blocking
Learning Objectives
FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
Todescribetherequirementsforfilesharing.
Toexplaintheconceptofrecordblocking.
FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
Inamultiusersystem,thereisalmostalwaysarequirementforallowingfilestobe
sharedamonganumberofusers.
Whenfilesharingamongusers,twocasesappear:
AccessRights
Managementofsimultaneousaccess
File Sharing
FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
Access Rights
Thefilesystemshouldprovideaflexibletoolforallowingextensivefilesharing
amongusers.
Thefollowingareaccessrightsthatcanbeassignedtoaparticularuserfora
particularfile.
None:Theuserwouldnotbeallowedtoreadtheuserdirectorythatincludes
thefile.
Knowledge:Theusercandeterminethatthefileexistsandwhoitsowneris.
Execution:Theusercanloadandexecuteaprogrambutcannotcopyit.
FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
Access Rights
Reading:Theusercanreadthefileforanypurpose,includingcopyingand
execution.
Appending:Theusercanadddatatothefilebutcannotmodifyordeleteanyof
thefile’scontents.
Updating:Theusercanmodify,delete,andaddtothefile’sdata.
Changingprotection:Theusercanchangetheaccessrightsgrantedtoother
users.
Deletion:Theusercandeletethefilefromthefilesystem.
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.
FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
Simultaneous Access
Whenaccessisgrantedtoappendorupdateafiletomorethanoneuser,the
operatingsystemorfilemanagementsystemmustenforcediscipline.
Abrute-forceapproachistoallowausertolocktheentirefilewhenitistobe
updated.
Afinergrainofcontrolistolockindividualrecordsduringupdate.
FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
Record Blocking
BlocksareunitofI/Owithsecondarystorage.
ForI/Otobeperformed,recordsmustbeorganizedasblocks.
Giventhesizeofblock,therearethreemethodsofblockingthatcanbeused;
Fixed-LengthBlocking:fixed-lengthrecordsareused,andanintegralnumberof
records(orbytes)arestoredinablock.
Internalfragmentation–unusedspaceattheendofeachblock.
Variable-LengthSpannedBlocking:variable-lengthrecordsareusedandarepacked
intoblockswithnounusedspace.
Variable-LengthUnspannedBlocking:variable-lengthrecordsareused,butspanning
isnotemployed.
FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
Record Blocking
R2 R3 R4 Track 1R1
R6 R7 R8 Track 2R5
Fixed blocking
R3 R4 R6 Track 1
R1
R8 R9 R13 Track 2R6
Variable blocking: spanned
R2 R4 R5
R7 R9 R10 R11 R12
R2 R4 R5 Track 1R1
R7 R8 R10 Track 2R6
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
FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
Summary
Inthislecture,youlearnedabout
File sharing in which access rights and access that can be provided to different
classes of users.
Three types of record blockings.
Learning Outcomes
FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
Aftertheendofthelecture,thestudentswillbeableto:
understandaccessrightsthatpermittoaccessordenyafileoradirectory.
knowaccessrightsthatcanbeprovidedtothedifferentclassofusers.
recognizethathowtousethreemethodsofblockingdependingonthesizeofthe
recordblocks.
References
FACULTY OF COMPUTER SCIENCE, UNIVERSITY OF COMPUTER STUDIES
1.“Operating Systems, internal and Design Principles” by William Stallings, 7
th
Edition, ISBN 13: 978-13-230998-1.