0% found this document useful (0 votes)
8 views20 pages

File MGMT L1

The document discusses file management in operating systems, detailing various file systems such as FAT, NTFS, ext, HFS, and APFS, along with their advantages and disadvantages. It also covers file access methods including sequential, direct, index sequential, relative record, and content-addressable access, highlighting their key features and performance implications. Additionally, the document explains directory structures, including single-level, two-level, and tree-structured directories, emphasizing their efficiency and organization benefits.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views20 pages

File MGMT L1

The document discusses file management in operating systems, detailing various file systems such as FAT, NTFS, ext, HFS, and APFS, along with their advantages and disadvantages. It also covers file access methods including sequential, direct, index sequential, relative record, and content-addressable access, highlighting their key features and performance implications. Additionally, the document explains directory structures, including single-level, two-level, and tree-structured directories, emphasizing their efficiency and organization benefits.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

FILE MANAGEMENT in OS

File Systems
• A file system is a method an operating system uses to store,
organize, and manage files and directories on a storage
device. Some common types of file systems include:
• FAT (File Allocation Table): An older file system used by
older versions of Windows and other operating systems.
• NTFS (New Technology File System): A modern file
system used by Windows. It supports features such as file
and folder permissions, compression, and encryption.
• ext (Extended File System): A file system commonly used
on Linux and Unix-based operating systems.
• HFS (Hierarchical File System): A file system used by
macOS.
• APFS (Apple File System): A new file system introduced
by Apple for their Macs and iOS devices.
Cont..
• The advantages of using a file system include the:
• Organization: A file system allows files to be organized into directories and
subdirectories, making it easier to manage and locate files.
• Data protection: File systems often include features such as file and folder
permissions, backup and restore, and error detection and correction, to protect data
from loss or corruption.
• Improved performance: A well-designed file system can improve the
performance of reading and writing data by organizing it efficiently on disk.
• Disadvantages of using a file system include:
• Compatibility issues: Different file systems may not be compatible with each
other, making it difficult to transfer data between different operating systems.
• Disk space overhead: File systems may use some disk space to store metadata and
other overhead information, reducing the amount of space available for user data.
• Vulnerability: File systems can be vulnerable to data corruption, malware, and
other security threats, which can compromise the stability and security of the
system.
• A file is a collection of related information that is recorded on secondary storage.
Or file is a collection of logically related entities. From the user’s perspective, a
file is the smallest allotment of logical secondary storage.
Cont..
• The name of the file is divided into two parts as shown below:
• name
• extension, separated by a period.
• Files attributes and its operations:
Cont..
File Access Methods in Operating System

• 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.
Cont..
• 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.
Cont..
• 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.
• 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.
Cont..
• 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.
Cont..
• 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.
Cont..

• 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.
Cont..
• 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.
Cont..
• 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.
Cont..
• 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.
Cont..
• 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.
Directory structure
• FILE DIRECTORIES:
• Collection of files is a file directory. The directory contains information
about the files, including attributes, location and ownership. Much of
this information, especially that is concerned with storage, is managed
by the operating system. The directory is itself a file, accessible by
various file management routines.
• Information contained in a device directory are:
• Name
• Type
• Address
• Current length
• Maximum length
• Date last accessed
• Date last updated
• Owner id
• Protection information
Cont..

• Operation performed on directory are:


• Search for a file
• Create a file
• Delete a file
• List a directory
• Rename a file
• Traverse the file system
• Advantages of maintaining directories are:
• Efficiency: A file can be located more quickly.
• Naming: It becomes convenient for users as two users can
have same name for different files or may have different name
for same file.
• Grouping: Logical grouping of files can be done by properties
e.g. all java programs, all games etc.
Cont..
• SINGLE-LEVEL DIRECTORY
• In this a single directory is maintained for all the users.
• Naming problem: Users cannot have same name for two files.
• Grouping problem: Users cannot group files according to their need.
Cont..
• TWO-LEVEL DIRECTORY
• In this separate directories for each user is maintained.
• Path name: Due to two levels there is a path name for every file to locate
that file.
• Now, we can have same file name for different user.
• Searching is efficient in this method.
Cont..
• TREE-STRUCTURED DIRECTORY :
• Directory is maintained in the form of a tree. Searching is efficient and also
there is grouping capability.
• We have absolute or relative path name for a file.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy