0% found this document useful (0 votes)
11 views23 pages

UNIT 3 OS

Uploaded by

navika Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views23 pages

UNIT 3 OS

Uploaded by

navika Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 23

Unit -3

I/O Device Management


The process of implementation, operation, and maintenance of a device by an operating
system is called device management. When we use computers we will be having various
devices connected to our system like mouse, keyboard, scanner, printer, and pen drives. So
all these are the devices and the operating system acts as an interface that allows the users to
communicate with these devices. An operating system is responsible for successfully
establishing the connection between these devices and the system. The operating system uses
the concept of drivers for establishing a connection between these devices with the system.
Functions of Device Management
 Keeps track of all devices and the program which is responsible to perform this is
called the I/O controller.
 Monitoring the status of each device such as storage drivers, printers, and other
peripheral devices.
 Enforcing preset policies and taking a decision on which process gets the device
when and for how long.
 Allocates and deallocates the device in an efficient way.

Types of Device
There are three main types of devices:
1. Block Device: It stores information in fixed-size block, each one with its own
address. Example, disks.
2. Character Device: It delivers or accepts a stream of characters. the individual
characters are not addressable. For example, printers, keyboards etc.
3. Network Device: It is for transmitting data packets.

Features of Device Management in Operating System


 Operating system is responsible in managing device communication through their
respective drivers.
 Operating system keeps track of all devices by using a program known as an input
output controller.
 It decides which process to assign to CPU and for how long.
 O.S. is responsible in fulfilling the request of devices to access the process.
 It connects the devices to various programs in efficient way without error.
 Deallocate devices when they are not in use.

Device Drivers
Operating system is responsible for managing device communication through their respective
drivers. As we know that the operating system will have many devices like the mouse,
printer, and scanner and the operating system is responsible for managing these devices and
establishing the communication between these devices with the computer through their
respective drivers. So the operating system uses its respective drivers and each device will
have its own driver. Without the use of their respective driver, that device cannot make
communication with other systems.
Device Tracking
Operating system keeps track of all devices by using a program known as input output
controller. Apart from allowing the system to make the communication between these
drivers, the operating system is also responsible in keeping track of all these devices which
are connected with the system. If any device requests any process which is under execution
by the CPU then the operating system has to send a signal to the CPU to immediately release
that process and move to the next process from the main memory so that the process which is
asked by the device fulfills the request of this device. That’s why the operating system has to
continuously keep on checking the status of all the devices and for doing that operating
system uses a specialized program which is known as Input/Output controller.
Process Assignment
Operating system decides which process to assign to the CPU and for how long. So the
operating system is responsible in assigning the processes to the CPU and it is also
responsible in selecting appropriate processes from the main memory and setting up the time
for that process like how long that process needs to get executed inside the CPU. Operating
system is responsible for fulfilling the request of devices to access the process. If the printer
requests for the process which is now getting executed by the CPU then it is the responsibility
of the operating system to fulfill that request. So what the operating system will do is it will
tell the CPU that you need to immediately release that process which the device printer is
asking for and assign it to the printer.
Connection
Operating system connects the devices to various programs in an efficient way without error.
So we use software to access these drivers because we cannot directly access the keyboard,
mouse, printers, scanners, etc. We have to access these devices with the help of software.
Operating systems help us in establishing an efficient connection with these devices with the
help of various software applications without any error.
Device Allocation
Device allocation refers to the process of assigning specific devices to processes or users. It
ensures that each process or user has exclusive access to the required devices or shares them
efficiently without interference.
Device Deallocation
Operating system deallocates devices when they are no longer in use. When these drivers or
devices are in use, they will be using a certain space in the memory so it is the responsibility
of the operating system to continuously keep checking which device is in use and which
device is not in use so that it can release that device if we are no longer using that device.
File Management
Files serve as containers for information, embodying documents, programs, multimedia, and
much more. Efficient file management encompasses a range of crucial tasks, such as creating,
deleting, and renaming files, as well as organizing them within a hierarchical structure.
Whether you’re a casual computer user or a seasoned IT professional, understanding the
principles and mechanisms of file management is essential for maximizing productivity and
ensuring the integrity and availability of your digital files. We will see and discuss different
types of file management in operating system.
What is File Management in OS?
File management in an operating system refers to the set of processes and techniques
involved in creating, organizing, accessing, manipulating, and controlling files stored on
storage devices such as hard drives, solid-state drives, or network storage. It encompasses a
range of tasks and functionalities that ensure efficient handling of files, including their
creation, deletion, naming, classification, and protection.
File management serves as the intermediary layer between applications and the underlying
storage hardware, providing a logical and organized structure for storing and retrieving data.
It involves managing file metadata, which includes attributes such as file name, file size,
creation date, access permissions, ownership, and file type.
Objectives of File Management in Operating System
The main objectives of file management in an operating system (OS) are:

 File organization: To provide a logical and efficient way of organizing files and
folders, so that they can be easily located and accessed by users.
 Data security: To protect files from unauthorized access, accidental deletion, or
modification and provide a mechanism for data recovery.
 Data sharing: To enable multiple users to access and edit the same file
simultaneously or share files with other devices on a network.
 File backup: To create copies of important files to prevent data loss in case of
hardware failure or other issues.
 File compression: To reduce the size of files to save disk space or to make them
easier to transfer over the internet.
 File encryption: To protect files from unauthorized access by encrypting them with
a password or other security measures.
 File retrieval: To provide an efficient way of searching and retrieving files based
on keywords, file attributes, or other parameters.
 Space management: To manage the storage space efficiently by allocating and
deallocating space as required by the files and folders.
 File versioning: To maintain multiple versions of a file, so that previous versions
can be accessed and compared if needed.
 File Auditing: To provide a mechanism to trace the files and folder access and
modification history.
Properties of File Management System
File management in an operating system involves the organization, manipulation, and
management of files on a computer’s storage devices. Some key properties of file
management include:
 File organization: The way in which files are stored, organized, and accessed on a
storage device. This can include things like file naming conventions, directory
structures, and file metadata.
 File access: The ways in which files can be opened, read, written, and closed. This
can include things like permissions and access controls, which determine who can
read and write to a file.
 File backup and recovery: The ability to create copies of files for safekeeping,
and to restore them in the event of data loss.
 File compression and encryption: The ability to compress and encrypt files to
save space and protect data.
 File indexing and search: The ability to search for files based on certain criteria,
such as keywords in the file name or contents, and quickly locate and open them.
 File sharing: The ability for multiple users to access and collaborate on the same
files, either locally or over a network.
Functions of File Management in Operating System
The file management function of the operating system includes:
 File creation: Creating new files and folders for storing data.
 File organization: Organizing files and folders in a logical and efficient manner,
such as grouping related files together in a common folder.
 File backup: Creating copies of important files to prevent data loss in case of
hardware failure or other issues.
 File search: Finding files quickly and easily by searching for keywords or file
attributes such as date created or file size.
 File compression: Reducing the size of files to save disk space or to make them
easier to transfer over the internet.
 File encryption: Protect files from unauthorized access by encrypting them with a
password or other security measures.
 File sharing: Allowing multiple users to access and edit the same file
simultaneously or share files with other devices on a network.
 File deletion: Removing files or folders from the storage device to free up space.
 File recovery: Restoring files that have been accidentally deleted or lost due to
system crashes or other issues.
 File permissions: Setting access controls for files and folders to determine who can
read, write, or execute them.
Types of File Management in Operating System
There are several types of file management in operating systems, including:

2. Sequential File Management: In a sequential file management system, files are


stored on storage devices in a sequential manner. Each file occupies a contiguous
block of storage space, and accessing data within the file requires reading from the
beginning until the desired location is reached. This type of file management is simple
but can be inefficient for random access operations.
3. Indexed File Management: Indexed file management utilizes an index structure
to improve file access efficiency. In this system, an index file is created alongside the
main data file, containing pointers to various locations within the file. These pointers
allow for quick navigation and direct access to specific data within the file.
4. Direct File Management: Direct file management, also known as random access
file management, enables direct access to any part of a file without the need to
traverse the entire file sequentially. It utilizes a file allocation table (FAT) or a similar
data structure to keep track of file locations. This approach allows for faster and more
efficient file access, particularly for larger files.
5. File Allocation Table (FAT) File System: The FAT file system is commonly
used in various operating systems, including older versions of Windows. It employs a
table, known as the file allocation table, to track the allocation status of each cluster
on a storage device. The FAT file system supports sequential and random access to
files and provides a simple and reliable file management structure.
6. New Technology File System (NTFS): NTFS is a more advanced file system
commonly used in modern Windows operating systems. It offers features such as
enhanced security, file compression, file encryption, and support for larger file sizes
and volumes. NTFS utilizes a complex structure to manage files efficiently and
provides advanced file management capabilities.
7. Distributed File Systems: Distributed file systems allow files to be stored across
multiple networked devices or servers, providing transparent access to files from
different locations. Examples include the Network File System (NFS) and the Server
Message Block (SMB) protocol used in network file sharing.

These are some of the commonly used types of file management systems in operating
systems, each with its own strengths and characteristics, catering to different requirements
and use cases.
Advantages of File Management in OS
The advantages of file management in operating system are as follows:

 Improved organization: A file management system allows for the efficient


organization of files and folders, making it easier to locate and access the files you
need.
 Data security: File management systems provide mechanisms for protecting files
from unauthorized access and accidental deletion, as well as data recovery in case of
failure.
 Data sharing: File management systems enable multiple users to access and edit
the same file simultaneously or share files with other devices on a network.
 Backup and recovery: File management systems can automatically create
backups of important files, making it easy to restore lost or damaged files.
 Compression: File management systems can compress files, reducing their size and
making them easier to transfer over the internet.
 Encryption: File management systems can encrypt files, making them secure and
protecting them from unauthorized access.
 Search and retrieval: File management systems provide efficient ways to search
and retrieve files based on keywords, file attributes, or other parameters.
 Space management: File management systems manage storage space efficiently,
allocating and deallocating space as required by the files and folders.
 Versioning: File management systems can maintain multiple versions of a file so
that previous versions can be accessed and compared if needed.
Limitations of File Management in OS
Some known limitations of the file management system are given below:
 Limited storage capacity: Depending on the size of the storage device, the
number of files that can be stored may be limited.
 Data security: File management systems may not provide adequate protection
against data breaches or cyber-attacks.
 Limited search capabilities: File management systems may not provide
advanced search capabilities, making it difficult to locate specific files among a large
number of files.
 Complexity: File management systems may be complex to use, especially for non-
technical users.
 Limited collaboration: File management systems may not have the capability to
support multiple users to access and edit the same file simultaneously.
 Limited backup and recovery options: File management systems may not
provide the option to backup files in multiple locations, or may not have advanced
recovery options.
 Dependence on the OS: File management systems are dependent on the OS they
are implemented in, and may not be compatible with other systems.
 Limited versioning: File management systems may not provide a robust
versioning system, making it difficult to manage different versions of a file.
 Limited Auditing: File management systems may not provide detailed auditing,
making it difficult to trace files and folder access and modification history.
 Limited scalability and flexibility: File management systems may be limited in
their ability to scale to accommodate growing needs or to be customized to suit the
specific requirements of an organization.
Examples of File Management System
Some examples of File Management System are :
1. Windows Explorer on Windows OS: Windows Explorer is the default file
management system on Windows operating systems. It allows users to organize and
manage files and folders and search for and access files.
2. Finder on macOS: Finder is the default file management system on macOS. It
allows users to organize and manage files and folders and search for and access files.
3. File Manager on Linux: Linux operating systems often come with a default file
manager such as Nautilus, Dolphin, or PCManFM that allows users to organize and
manage files and folders, as well as search for and access files.
4. Network-attached storage (NAS) systems are specialized file management
systems that can store and manage files on a network, allowing multiple users to
access and edit files simultaneously.
5. Cloud-based file storage services: Services like Dropbox, Google Drive, and
OneDrive provide a file management system that allows users to store and manage
files in the cloud, allowing access from multiple devices and collaboration with other
users.
6. Content management systems (CMS): These are specialized file management
systems that allow users to manage and organize digital assets like images, videos,
and documents, and also provide options for versioning and tagging.
7. Source code management systems: These are specialized file management
systems for managing source code, for example, Git, and SVN.
8. Database management systems: These are specialized file management systems
that allow users to manage and organize large amounts of structured data, for
example, MySQL, MongoDB, and PostgreSQL.
OS File Operations
File operations within an operating system (OS) encompass a set of essential tasks and
actions directed at files and directories residing within a computer’s file system. These
operations are fundamental for the effective management and manipulation of data stored on
various storage devices. In this article, we will learn different file operations and what are the
system calls and APIs used to perform them in a Linux / Windows-based OS.
File Creation and Manipulation
File Creation and Manipulation encompasses essential operations within an operating system
that involve creating, modifying, and organizing files and directories. These actions are vital
for managing data efficiently and are integral to the functioning of computer systems.

File Operation Description System Calls / APIs

Create a new file for data  open() (Linux-like


Creating Files systems)
storage.
 CreateFile() (Windows)
Creating Create a new directory  mkdir() (Linux systems)
Directories for organizing files.  CreateDirectory()
(Windows)

Open a file that you


Opening Files already have open to  open() (Linux systems)
read or write from.  CreateFile() (Windows)

Retrieve data from an  read() (Linux systems)


Reading Files
open file.  ReadFile() (Windows)

Writing Files Store data in an open file.  write() (Linux systems)


 WriteFile() (Windows)

Renaming Files If you want to rename a  rename() (Linux systems)


and Directories file or directory,.  MoveFile() (Windows)

 unlink() (Linux systems)


Deleting Files Remove files or  remove() (Linux systems)
and Directories directories.  DeleteFile() (Windows)
 RemoveDirectory()
(Windows)

File Organization and Search


File organization and search are key OS operations for arranging files systematically
and swiftly locating specific data, optimizing file management and user efficiency.
File Operation Description System Calls / APIs

Copying Create duplicates of files  cp (Linux systems)


Files in another location.  CopyFile() (Windows)

Relocate files from one  mv (Linux systems)


Moving Files
location to another.  MoveFile() (Windows)

Searching Locate files based on  find (Linux systems)


for Files specific criteria.  FindFirstFile() and
FindNextFile() (Windows)

File Security and Metadata


File Security and Metadata are vital components of file management, encompassing access
control and crucial file information preservation within an operating system. They are
essential for data security and efficient organization.
File Operation Description System Calls / APIs

File Control access rights to  chmod (Linux systems)


Permissions files and directories.  SetFileSecurity (Windows)

File Assign specific users or  chown (Linux systems)


Ownership groups as file owners.  SetFileSecurity (Windows)
File Retrieve and manipulate  stat (Linux systems)
Metadata file information.  GetFileAttributesEx
(Windows)

File Compression and Encryption


File Compression and Encryption are essential for optimizing storage and enhancing data
security. Compression reduces file sizes, while encryption safeguards data privacy by making
it unreadable without the correct decryption key.

File
Description System Calls / APIs
Operation

File Reduce file sizes to save  gzip, zip, tar (Linux systems),
Compression storage space.  Compress-Archive (Windows)

Protect data by  openssl, gpg (Linux systems)


File  Windows provides encryption
converting it into an
Encryption libraries and APIs for
unreadable format.
encryption operations.

File Access Methods


When a file is used, information is read and accessed into computer memory and there are
several ways to access this information of the file. Some systems provide only one access
method for files. Other systems, such as those of IBM, support many access methods, and
choosing the right one for a particular application is a major design problem.
There are three ways to access a file into a computer system: Sequential-Access, Direct
Access, Index sequential Method.
1. Sequential Access –
It is the simplest access method. Information in the file is processed in order, one
record after the other. This mode of access is by far the most common; for
example, editor and compiler usually access the file in this fashion.
Read and write make up the bulk of the operation on a file. A read operation -read
next- read the next position of the file and automatically advance a file pointer,
which keeps track I/O location. Similarly, for the -write next- append to the end of
the file and advance to the newly written material.
Key points:
 Data is accessed one record right after another record in an order.
When we use read command, it move ahead pointer by one

When we use write command, it will allocate memory and move the

pointer to the end of the file
 Such a method is reasonable for tape.
Advantages of Sequential Access Method :
 It is simple to implement this file access mechanism.
 It uses lexicographic order to quickly access the next entry.
 It is suitable for applications that require access to all records in a file, in a
specific order.
 It is less prone to data corruption as the data is written sequentially and not
randomly.
 It is a more efficient method for reading large files, as it only reads the required
data and does not waste time reading unnecessary data.
 It is a reliable method for backup and restore operations, as the data is stored
sequentially and can be easily restored if required.

Disadvantages of Sequential Access Method :


 If the file record that needs to be accessed next is not present next to the current
record, this type of file access method is slow.
 Moving a sizable chunk of the file may be necessary to insert a new record.
 It does not allow for quick access to specific records in the file. The entire file
must be searched sequentially to find a specific record, which can be time-
consuming.
 It is not well-suited for applications that require frequent updates or modifications
to the file. Updating or inserting a record in the middle of a large file can be a
slow and cumbersome process.
 Sequential access can also result in wasted storage space if records are of varying
lengths. The space between records cannot be used by other records, which can
result in inefficient use of storage.

2.Direct Access –
Another method is direct access method also known as relative access method. A fixed-
length logical record that allows the program to read and write record rapidly. in no particular
order. The direct access is based on the disk model of a file since disk allows random access
to any file block. For direct access, the file is viewed as a numbered sequence of block or
record. Thus, we may read block 14 then block 59, and then we can write block 17. There is
no restriction on the order of reading and writing for a direct access file.
A block number provided by the user to the operating system is normally a relative block
number, the first relative block of the file is 0 and then 1 and so on.

Advantages of Direct Access Method :


 The files can be immediately accessed, decreasing the average access time.
 In the direct access method, in order to access a block, there is no need of
traversing all the blocks present before it.
3.Index sequential method –
It is the other method of accessing a file that is built on the top of the sequential access
method. These methods construct an index for the file. The index, like an index in the back of
a book, contains the pointer to the various blocks. To find a record in the file, we first search
the index, and then by the help of pointer we access the file directly.
Key points:
 It is built on top of Sequential access.
 It control the pointer by using index.

4.Relative Record Access –


Relative record access is a file access method used in operating systems where records are
accessed relative to the current position of the file pointer. In this method, records are located
based on their position relative to the current record, rather than by a specific address or key
value.
Key Points of Relative Record Access:
Relative record access is a random access method that allows records to be accessed based on
their position relative to the current record.
This method is efficient for accessing individual records but may not be suitable for files that
require frequent updates or random access to specific records.
Relative record access requires fixed-length records and may not be flexible enough for some
applications.
This method is useful for processing records in a specific order or for files that are accessed
sequentially.
Advantages of Relative Record Access:
Random Access: Relative record access allows random access to records in a file. The
system can access any record at a specific offset from the current position of the file pointer.
Efficient Retrieval: Since the system only needs to read the current record and any records
that need to be skipped, relative record access is more efficient than sequential access for
accessing individual records.
Useful for Sequential Processing: Relative record access is useful for processing records in
a specific order. For example, if the records are sorted in a specific order, the system can
access the next or previous record relative to the current position of the file pointer.
Disadvantages of Relative Record Access:
Fixed Record Length: Relative record access requires fixed-length records. If the records
are of varying length, it may be necessary to use padding to ensure that each record is the
same length.
Limited Flexibility: Relative record access is not very flexible. It is difficult to insert or
delete records in the middle of a file without disrupting the relative positions of other records.
Limited Application: Relative record access is best suited for files that are accessed
sequentially or with some regularity, but it may not be appropriate for files that are frequently
updated or require random access to specific records.
5.Content Addressable Access-
Content-addressable access (CAA) is a file access method used in operating systems that
allows records or blocks to be accessed based on their content rather than their address. In
this method, a hash function is used to calculate a unique key for each record or block, and
the system can access any record or block by specifying its key.
Keys in Content-Addressable Access:
Unique: Each record or block has a unique key that is generated using a hash function.
Calculated based on content: The key is calculated based on the content of the record or
block, rather than its location or address.
Advantages of Content-Addressable Access:
Efficient Search: CAA is ideal for searching large databases or file systems because it
allows for efficient searching based on the content of the records or blocks.
Flexibility: CAA is more flexible than other access methods because it allows for easy
insertion and deletion of records or blocks.
Data Integrity: CAA ensures data integrity because each record or block has a unique key
that is generated based on its content.
Disadvantages of Content-Addressable Access:
Overhead: CAA requires additional overhead because the hash function must be calculated
for each record or block.
Collision: There is a possibility of collision where two records or blocks can have the same
key. This can be minimized by using a good hash function, but it cannot be completely
eliminated.
Limited Key Space: The key space is limited by the size of the hash function used, which
can lead to collisions and other issues.
Key Points of Content-Addressable Access:
Content-addressable access is a file access method that allows records or blocks to be
accessed based on their content rather than their address.
CAA uses a hash function to generate a unique key for each record or block.
CAA is efficient for searching large databases or file systems and is more flexible than other
access methods.
CAA requires additional overhead for calculating the hash function and may have collisions
or limited key space.
Structures of Directory in Operating System
A directory is a container that is used to contain folders and files. It organizes files and
folders in a hierarchical manner.
Following are the logical structures of a directory, each providing a solution to the
problem faced in the previous type of directory structure.
1) Single-level directory:

The single-level directory is the simplest directory structure. In it, all files are contained in
the same directory which makes it easy to support and understand.
A single level directory has a significant limitation, however, when the number of files
increases or when the system has more than one user. Since all the files are in the same
directory, they must have a unique name. If two users call their dataset test, then the unique
name rule is violated.

Advantages:
 Since it is a single directory, so its implementation is very easy.
 If the files are smaller in size, searching will become faster.
 The operations like file creation, searching, deletion, updating are very easy in
such a directory structure.
 Logical Organization: Directory structures help to logically organize files and
directories in a hierarchical structure. This provides an easy way to navigate and
manage files, making it easier for users to access the data they need.
 Increased Efficiency: Directory structures can increase the efficiency of the file
system by reducing the time required to search for files. This is because directory
structures are optimized for fast file access, allowing users to quickly locate the
file they need.
 Improved Security: Directory structures can provide better security for files by
allowing access to be restricted at the directory level. This helps to prevent
unauthorized access to sensitive data and ensures that important files are
protected.
 Facilitates Backup and Recovery: Directory structures make it easier to backup
and recover files in the event of a system failure or data loss. By storing related
files in the same directory, it is easier to locate and backup all the files that need to
be protected.
 Scalability: Directory structures are scalable, making it easy to add new
directories and files as needed. This helps to accommodate growth in the system
and makes it easier to manage large amounts of data.
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.
 This can not group the same type of files together.

2) Two-level directory:
As we have seen, a single level directory often leads to confusion of files names among
different users. The solution to this problem is to create a separate directory for each user.
In the two-level directory structure, each user has their own user files directory (UFD). The
UFDs have similar structures, but each lists only the files of a single user. System’s master
file directory (MFD) is searched whenever a new user id is created.

Two-Levels Directory Structure


Advantages:
 The main advantage is there can be more than two files with the same name, and
would be very helpful if there are multiple users.
 Security would be there which would prevent users from access other user’s files.
 Searching for the files becomes very easy in this directory structure.

Disadvantages:
 As there is an advantage of security, there is also a 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.
 Scalability is not possible because one use can’t group the same types of files
together.

3) Tree Structure/ Hierarchical Structure:


Tree directory structure of operating system is most commonly used in our personal
computers. User can create files and subdirectories too, which was a disadvantage in the
previous directory structures.
This directory structure resembles a real tree upside down, where the root directory is at the
peak. 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. The structure of tree
directory is given below which shows how there are files and subdirectories in each user’s
directory.

Tree/Hierarchical Directory Structure


Advantages:
 This directory structure allows subdirectories inside a directory.
 The searching is easier.
 File sorting of important and unimportant becomes easier.
 This directory is more scalable than the other two directory structures explained.
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.
 If files do not fit in one, they might have to be fit into other directories.
4) Acyclic Graph Structure:
As we have seen the above three directory structures, where none of them have the capability
to access one file from multiple directories. The file or the subdirectory could be accessed
through the directory it was present in, but not from the other directory.
This problem is solved in acyclic graph directory structure, where a file in one directory can
be accessed from multiple directories. In this way, the files could be shared in between the
users. It is designed in a way that multiple directories point to a particular directory or file
with the help of links.
In the below figure, this explanation can be nicely observed, where a file is shared between
multiple users. If any user makes a change, it would be reflected to both the users.

Acyclic Graph Structure


Advantages:
 Sharing of files and directories is allowed between multiple users.
 Searching becomes too easy.
 Flexibility is increased as file sharing and editing access is there for multiple
users.
Disadvantages:
 Because of the complex structure it has, it is difficult to implement this directory
structure.
 The user must be very cautious to edit or even deletion of file as the file is
accessed by multiple users.
 If we need to delete the file, then we need to delete all the references of the file
inorder to delete it permanently.

Remote File System (RFS)


Files can be shared across the network via variety of methods –
 Using FTP i.e., file transfer protocol is used to transfer file from one computer to
other.
 Using distributed file system (DFS) in which remote directories are visible from
local machine.
 Using Remote File System (RFS) in which the arrival of networks has allowed
communication between remote computer. These networks allows various
hardware and software resources to be shared throughout the world.

Remote file sharing (RFS) is a type of distributed file system technology. It was developed in
1980 by AT&T. Later, it was delivered with UNIX System version V (five) release 3
(SVR3). It enables file and/or data access to multiple remote users over the Internet or a
network connection. It is also known as a general process of providing remote user access to
locally stored files and/or data.
It was relied on the STREAMS Transport Provider Interface feature of the operating system.
To implement remote file system we use client-server model. It was one of the basic
application of Remote File System.
Client-Server Model in RFS :
RFS allows a computer to support one or more file systems from one or more remote
machines. In this case, the machine containing the files is server and the machine wanting
access to the files is the client. The server specifies which file can be accessed by a particular
client(s). Files are usually specified on a partition level.
A server can serve multiple clients, and a client can access multiple servers, depending on the
implementation details of a given client-server facility. Once it is mounted, file operation
requests are sent on the behalf of the user to the server, via network.
For example, a user sends a file open request to the server along with its ID. The server then
check file access to determine if the user has rights to access the file requested mode. This
request is either allowed or denied. If it is allowed, a file is returned to the client application,
and the application then may perform read, write and other operations on file.
After the required operation is performed, the client closes the files.
File protection
Introduction
File protection in an operating system is the process of securing files from unauthorized
access, alteration, or deletion. It is critical for data security and ensures that sensitive
information remains confidential and secure. Operating systems provide various mechanisms
and techniques such as file permissions, encryption, access control lists, auditing, and
physical file security to protect files. Proper file protection involves user authentication,
authorization, access control, encryption, and auditing. Ongoing updates and patches are also
necessary to prevent security breaches. File protection in an operating system is essential to
maintain data security and minimize the risk of data breaches and other security incidents.
What is File protection?
File protection in an operating system refers to the various mechanisms and techniques used
to secure files from unauthorized access, alteration, or deletion. It involves controlling access
to files, ensuring their security and confidentiality, and preventing data breaches and other
security incidents.
Operating systems provide several file protection features, including file permissions,
encryption, access control lists, auditing, and physical file security. These measures allow
administrators to manage access to files, determine who can access them, what actions can be
performed on them, and how they are stored and backed up. Proper file protection requires
ongoing updates and patches to fix vulnerabilities and prevent security breaches. It is crucial
for data security in the digital age where cyber threats are prevalent. By implementing file
protection measures, organizations can safeguard their files, maintain data confidentiality,
and minimize the risk of data breaches and other security incidents.
Type of File protection
File protection is an essential component of modern operating systems, ensuring that files are
secured from unauthorized access, alteration, or deletion. In this context, there are several
types of file protection mechanisms used in operating systems to provide robust data security.

 File Permissions − File permissions are a basic form of file protection that controls
access to files by setting permissions for users and groups. File permissions allow the
system administrator to assign specific access rights to users and groups, which can
include read, write, and execute privileges. These access rights can be assigned at the
file or directory level, allowing users and groups to access specific files or directories
as needed. File permissions can be modified by the system administrator at any time
to adjust access privileges, which helps to prevent unauthorized access.
 Encryption − Encryption is the process of converting plain text into ciphertext to
protect files from unauthorized access. Encrypted files can only be accessed by
authorized users who have the correct encryption key to decrypt them. Encryption is
widely used to secure sensitive data such as financial information, personal data, and
other confidential information. In an operating system, encryption can be applied to
individual files or entire directories, providing an extra layer of protection against
unauthorized access.
 Access Control Lists (ACLs) − Access control lists (ACLs) are lists of permissions
attached to files and directories that define which users or groups have access to them
and what actions they can perform on them. ACLs can be more granular than file
permissions, allowing the system administrator to specify exactly which users or
groups can access specific files or directories. ACLs can also be used to grant or deny
specific permissions, such as read, write, or execute privileges, to individual users or
groups.
 Auditing and Logging − Auditing and logging are mechanisms used to track and
monitor file access, changes, and deletions. It involves creating a record of all file
access and changes, including who accessed the file, what actions were performed,
and when they were performed. Auditing and logging can help to detect and prevent
unauthorized access and can also provide an audit trail for compliance purposes.
 Physical File Security − Physical file security involves protecting files from physical
damage or theft. It includes measures such as file storage and access control, backup
and recovery, and physical security best practices. Physical file security is essential
for ensuring the integrity and availability of critical data, as well as compliance with
regulatory requirements.

Overall, these types of file protection mechanisms are essential for ensuring data security and
minimizing the risk of data breaches and other security incidents in an operating system. The
choice of file protection mechanisms will depend on the specific requirements of the
organization, as well as the sensitivity and volume of the data being protected. However, a
combination of these file protection mechanisms can provide comprehensive protection
against various types of threats and vulnerabilities.
Advantages of File protection
File protection is an important aspect of modern operating systems that ensures data security
and integrity by preventing unauthorized access, alteration, or deletion of files. There are
several advantages of file protection mechanisms in an operating system, including −

 Data Security − File protection mechanisms such as encryption, access control lists,
and file permissions provide robust data security by preventing unauthorized access to
files. These mechanisms ensure that only authorized users can access files, which
helps to prevent data breaches and other security incidents. Data security is critical for
organizations that handle sensitive data such as personal data, financial information,
and intellectual property.
 Compliance − File protection mechanisms are essential for compliance with
regulatory requirements such as GDPR, HIPAA, and PCI-DSS. These regulations
require organizations to implement appropriate security measures to protect sensitive
data from unauthorized access, alteration, or deletion. Failure to comply with these
regulations can result in significant financial penalties and reputational damage.
 Business Continuity − File protection mechanisms are essential for ensuring business
continuity by preventing data loss due to accidental or malicious deletion, corruption,
or other types of damage. File protection mechanisms such as backup and recovery,
auditing, and logging can help to recover data quickly in the event of a data loss
incident, ensuring that business operations can resume as quickly as possible.
 Increased Productivity − File protection mechanisms can help to increase
productivity by ensuring that files are available to authorized users when they need
them. By preventing unauthorized access, alteration, or deletion of files, file
protection mechanisms help to minimize the risk of downtime and data loss incidents
that can impact productivity.
 Enhanced Collaboration − File protection mechanisms can help to enhance
collaboration by allowing authorized users to access and share files securely. Access
control lists, file permissions, and encryption can help to ensure that files are only
accessed by authorized users, which helps to prevent conflicts and misunderstandings
that can arise when multiple users access the same file.
 Reputation − File protection mechanisms can enhance an organizations reputation by
demonstrating a commitment to data security and compliance. By implementing
robust file protection mechanisms, organizations can build trust with their customers,
partners, and stakeholders, which can have a positive impact on their reputation and
bottom line.

Overall, these advantages of file protection mechanisms highlight the importance of data
security and the need for organizations to implement appropriate measures to protect their
sensitive data. File protection mechanisms can help to prevent data breaches and other
security incidents, ensure compliance with regulatory requirements, and ensure business
continuity in the event of a data loss incident. By implementing a comprehensive file
protection strategy, organizations can enhance productivity, collaboration, and reputation,
while minimizing the risk of data loss and other security incidents.
Disadvantages of File protection
There are also some potential disadvantages of file protection in an operating system,
including −

 Overhead − Some file protection mechanisms such as encryption, access control lists,
and auditing can add overhead to system performance. This can impact system
resources and slow down file access and processing times.
 Complexity − File protection mechanisms can be complex and require specialized
knowledge to implement and manage. This can lead to errors and misconfigurations
that compromise data security.
 Compatibility Issues − Some file protection mechanisms may not be compatible with
all types of files or applications, leading to compatibility issues and limitations in file
usage.
 Cost − Implementing robust file protection mechanisms can be expensive, especially
for small organizations with limited budgets. This can make it difficult to achieve full
data protection.
 User Frustration − Stringent file protection mechanisms such as complex passwords,
frequent authentication requirements, and restricted access can frustrate users and
impact productivity.

Overall, these potential disadvantages of file protection mechanisms need to be balanced


against the advantages they offer in terms of data security, compliance, and business
continuity. Careful planning and implementation are necessary to minimize the impact of
these disadvantages and ensure effective file protection in an operating system.
Conclusion
In conclusion, file protection mechanisms are essential for ensuring data security,
compliance, and business continuity in modern operating systems. These mechanisms
provide several advantages, including data security, compliance with regulatory
requirements, business continuity, increased productivity, enhanced collaboration, and
reputation. However, there are also some disadvantages, such as increased system overhead
and complexity, and potential limitations on user flexibility. Despite these limitations, the
benefits of file protection mechanisms outweigh the disadvantages, and organizations should
implement appropriate file protection mechanisms to protect their sensitive data and ensure
their operations are not impacted by security incidents.

You might also like