What is File System? | Types of File and It's Functions Full Guide

What is File System | What are the types of file system

It provides mechanisms for on-line storage and access to both the operating system and all user data and programs of the computer system. 

A file system has two distinct parts, a collection of files, each storage-related data, and a directory structure, which provides information about all files in the system, the third part of some file systems, the partition, which Used to separate physically or logically large collections of directories.

What is File System

What is File System?


Computers can store information on many different storage media such as magnetic disks, magnetic tapes, and optical disks. 

So that the computer system is convenient to use, the operating system provides a similar logical view of information storage to define a logical storage unit (ie, file) from the physical properties of its storage devices to abstract the operating system.

From the user's perspective, a file is the smallest allocation of logical secondary storage, which means that data cannot be written to secondary storage, unless it is within the file. 

In general, files represent programs (both source and object forms) and data.  Data files can be numeric, alphabetical, alphanumeric or binary.

Many different types of information can be stored in file-source programs, object programs, executable programs, etc.

There is a fixed defined structure according to the type of file. A text file is a sequence of characters organized into rows (and possibly pages). 
A source file is a sub-method and a sequence of tasks, each of which is organized into declarations after executable statements. 

An object is a sequence of bytes arranged in blocks understood by the linker of the file system

An executable file is a series of code sections, which the loader can bring into memory and execute.

What is File System


File Attributes:

A file has some other characteristics that differ from one operating system to another, but typically include:

1 Name: 

The symbolic filename is kept in human-readable form only.

2 Identifier: 

This unique tag, usually a number, identifies a file within the file system: it is a non-human-readable name for the file.

3 Types: 

This information is needed for systems that support different types.

4 Location: 

This information is an indicator for the device and the location of the file on that device.

5 Size: 

The current size of the file (in bytes, words or blocks), and possibly the maximum allowed size included in this attribute.

6 Protection: 

Access-control information determines who can read, write, execute and so on.

7 Time, date, and user identification: 

This information can be kept for creation, final modification, and final use. These can be useful for data security, security and usage monitoring.

What is File System

File operations:

A file is an abstract data type To define a file properly, we need to consider the operations that can be performed on files.

It consists of six operations: -

1 Creating a file:

Two steps are required to create a file. First, the location in the file system must be found for the file. Second, an entry for the new file must be created in the directory.

2 Writing a file:

To write a file: file name and infromation to the file written in the file.

3 Reading a file: 

To read from a file, we use a system call that specifies the name of the file and where the next block in the file should be placed (in memory).

4 Repositioning within a file (Repositioning within a file): 

The directory is searching for an appropriate entry, and the current file position is set to a defined value.

5 Deleting a file: 

To delete a file,

6 Truncating a file: 

Users want to delete the contents of a file, but can retain its attributes. Instead of forcing the user to delete the file and then rebuild it

Types of files

Data files are classified in the way they are used. File management supports the following types of files:


1 Transaction file:

 A transaction file is used to store input data until it can be processed. For example payroll processing application


2 Master file: 

A master file contains all the current data relevant to an application. A master file will contain permanent details - eg - employee name, address, employee code etc.


3 Output file:

Some applications use multiple programs for data processing. In such applications, the output produced by one program is often used as an input to another program. 

So the output produced by the prior program is stored in a file, it is called the output file.


4 Report file: 

A report file is a copy of a report generated in a computer-accessible form by a data processing application.


5 Backup file: 

A backup file is a copy of a file that was created as a security precaution due to loss of data of the original file.

Post a comment