MODULE CO4
MODULE CO4
MODULE CO4
• A text files
• An object files
• A source files
File Attributes
It stores meta information like file creation date and time, current size, last
modified date, etc. All this information is called the attributes of a file
system.
File attributes:
• Name
• Identifier
• Location
• Type
• Size
• Protection
• Time, date and security
Directory
• The collection of files is a file directory.
• The directory contains information about the files, including attributes,
location, and ownership.
Various file operations
• A file is a collection of logically related data that is recorded on the
secondary storage in the form of sequence of operations.
• The various operations which can be implemented on a file such as read,
write, open and close etc. are called file operations.
1.Create: This operation is used to create a new file in the file system
2.Open: Once the file is created, it must be opened before performing the file
processing operations.
2. Two-level directory:
• Here creates 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 list only the files of a single
user. System’s master file directory (MFD) is searched whenever a new
user id is correct.
• Contiguous Allocation
• Linked Allocation
• Indexed Allocation
Contiguous Allocation
Contiguous Allocation allocate each file in a contiguous set of blocks on the disk.
Advantage
• Easy to implement
• Excellent read performance
Disadvantage
Advantage
• No external fragmentation
• File size can increase
Disadvantage
Indexed Allocation
In this method,
• Indexed allocation have a special block is called index block.
• An index block contains the pointer to all the blocks occupied by a file.
• Directory contains the addresses of index blocks of the specific files.
• Each file has its own index block.
Advantage
• No external fragmentation
• Support direct access
Disadvantage
• Multilevel index
• Overhead of pointer
Seek time: The time it takes for the read/write head to find the data on the disk.
Latency time: The time it takes for the sector containing the data to rotate into position under the head.
• SSTF stands for Shortest Seek Time First is a disk scheduling algorithm.
• In SSTF the tracks that are closer to the current disk head position
should be serviced first in order to minimize the seek operations is
basically known as Shortest Seek Time First (SSTF).
• It provides better throughput.
• This algorithm is used in Batch Processing systems.
• It has a less average response and waiting time.
E.g.: Here gives an array of track number is 98,37,14,124,65,67 and
initial head position is 32.
Advantage
• It minimizes the latency time
• Better through than FCFS
Disadvantage
• Starvation may occur.
• It is not optimal
4.C-SCAN algorithm
• It is circular SCAN algorithm.
• The (C-SCAN) Scheduling Algorithm is a modified version of the SCAN Disk Scheduling
Algorithm
• Like SCAN (Elevator Algorithm), C-SCAN moves the head from one end servicing all
the requests to the other end.
• Then it immediately returns to the beginning of the disk without
servicing any requests on the return trip and starts servicing again once
reaches the beginning.
• In this algorithm, the direction must be considered, that is, towards larger or
smaller value.
• This algorithm moves towards the end of disk requests and serves them.
Advantage
• It provides better response time
• It provides uniform waiting time.
Dis advantage
• May not be fair to service requests for tracks at the extreme end.
• It has more seek movements as compared to the SCAN Algorithm.