OSY Chapter 6 Notes
OSY Chapter 6 Notes
OSY Chapter 6 Notes
File Management
Define File
In Operating Systems (OS), a file is a collection of related data or information
that is stored on a computer's storage device, such as a hard drive, solid-state drive,
or flash drive.
File Operations
3. Tree Structure
The file ‘mail’ in the following figure starts from the block 19
with length = 6 blocks. Therefore, it occupies 19, 20, 21, 22,
23, 24 blocks.
The file ‘list’ in the following figure starts from the block 28
with length = 4 blocks. Therefore, it occupies 28,29,30,31
blocks.
Advantages
Single-Level Directory
Disadvantages
There may chance of name collision because two files can have the same
name.
Searching will become time taking if the directory is large.
Difficult to remember names of each file when there are large amount of
files in a directory
Two-Level Directory
All the UFDs have similar structures, but each lists contain
only the files of a single user.
System’s master file directory (MFD) is searched
whenever a new user id is created.
Advantages
The main advantage is there can be more than two files with same
name, and would be very helpful if there are multiple users.
A security would be there which would prevent user to access other
user’s files.
Searching of the files becomes very easy in this directory structure.
Disadvantages
As there is advantage of security, there is also disadvantage that the
user cannot share the file with the other users.
Unlike the advantage users can create their own files, users don’t have
the ability to create subdirectories.
Tree Structure Directory
This root contains all the directories for each user. The users can
create subdirectories and even store files in their directory.
A user do not have access to the root directory data and cannot
modify it. And, even in this directory the user do not have access
to other user’s directories.
Disadvantages
As the user isn’t allowed to access other user’s directory, this prevents
the file sharing among users.
As the user has the capability to make subdirectories, if the number of
subdirectories increase the searching may become complicated.
Users cannot modify the root directory data.
Disk Structure
RAID Structures: