Skip to main content

No of common type files in operating system

 

No of common type files in operating system

What is File System?

A file is a collection of correlated information which is recorded on secondary or non-volatile storage like magnetic disks, optical disks, and tapes. It is a method of data collection that is used as a medium for giving input and receiving output from that program.

In general, a file is a sequence of bits, bytes, or records whose meaning is defined by the file creator and user. Every File has a logical location where they are located for storage and retrieval.

Objective of File management System

Here are the main objectives of the file management system:

  • It provides I/O support for a variety of storage device types.
  • Minimizes the chances of lost or destroyed data
  • Helps OS to standardized I/O interface routines for user processes.
  • It provides I/O support for multiple users in a multiuser systems environment.

Properties of a File System

Here, are important properties of a file system:

  • Files are stored on disk or other storage and do not disappear when a user logs off.
  • Files have names and are associated with access permission that permits controlled sharing.
  • Files could be arranged or more complex structures to reflect the relationship between them.

File structure

A File Structure needs to be predefined format in such a way that an operating system understands . It has an exclusively defined structure, which is based on its type.

Three types of files structure in OS:

  • A text file: It is a series of characters that is organized in lines.
  • An object file: It is a series of bytes that is organized into blocks.
  • A source file: It is a series of functions and processes.

File Attributes

A file has a name and data. Moreover, it also 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.

Here, are some important File attributes used in OS:

  • Name: It is the only information stored in a human-readable form.
  • Identifier: Every file is identified by a unique tag number within a file system known as an identifier.
  • Location: Points to file location on device.
  • Type: This attribute is required for systems that support various types of files.
  • Size. Attribute used to display the current file size.
  • Protection. This attribute assigns and controls the access rights of reading, writing, and executing the file.
  • Time, date and security: It is used for protection, security, and also used for monitoring

File Type

It refers to the ability of the operating system to differentiate various types of files like text files, binary, and source files. However, Operating systems like MS_DOS and UNIX has the following type of files:

Character Special File

It is a hardware file that reads or writes data character by character, like mouse, printer, and more.

Ordinary files

  • These types of files stores user information.
  • It may be text, executable programs, and databases.
  • It allows the user to perform operations like add, delete, and modify.

Directory Files

  • Directory contains files and other related information about those files. Its basically a folder to hold and organize multiple files.

Special Files

  • These files are also called device files. It represents physical devices like printers, disks, networks, flash drive, etc.

Functions of File

  • Create file, find space on disk, and make an entry in the directory.
  • Write to file, requires positioning within the file
  • Read from file involves positioning within the file
  • Delete directory entry, regain disk space.
  • Reposition: move read/write position.

Commonly used terms in File systems

Field:

This element stores a single value, which can be static or variable length.

DATABASE:

Collection of related data is called a database. Relationships among elements of data are explicit.

FILES:

Files is the collection of similar record which is treated as a single entity.

RECORD:

A Record type is a complex data type that allows the programmer to create a new data type with the desired column structure. Its groups one or more columns to form a new data type. These columns will have their own names and data type.

File Access Methods

File access is a process that determines the way that files are accessed and read into memory. Generally, a single access method is always supported by operating systems. Though there are some operating system which also supports multiple access methods.

Three file access methods are:

  • Sequential access
  • Direct random access
  • Index sequential access

Sequential Access

In this type of file access method, records are accessed in a certain pre-defined sequence. In the sequential access method, information stored in the file is also processed one by one. Most compilers access files using this access method.

Random Access

The random access method is also called direct random access. This method allow accessing the record directly. Each record has its own address on which can be directly accessed for reading and writing.

Sequential Access

This type of accessing method is based on simple sequential access. In this access method, an index is built for every file, with a direct pointer to different memory blocks. In this method, the Index is searched sequentially, and its pointer can access the file directly. Multiple levels of indexing can be used to offer greater efficiency in access. It also reduces the time needed to access a single record.

Space Allocation

In the Operating system, files are always allocated disk spaces.

Three types of space allocation methods are:

  • Linked Allocation
  • Indexed Allocation
  • Contiguous Allocation

Contiguous Allocation

In this method,

  • Every file users a contiguous address space on memory.
  • Here, the OS assigns disk address is in linear order.
  • In the contiguous allocation method, external fragmentation is the biggest issue.

Linked Allocation

In this method,

  • Every file includes a list of links.
  • The directory contains a link or pointer in the first block of a file.
  • With this method, there is no external fragmentation
  • This File allocation method is used for sequential access files.
  • This method is not ideal for a direct access file.

Indexed Allocation

In this method,

  • Directory comprises the addresses of index blocks of the specific files.
  • An index block is created, having all the pointers for specific files.
  • All files should have individual index blocks to store the addresses for disk space.

File Directories

A single directory may or may not contain multiple files. It can also have sub-directories inside the main directory. Information about files is maintained by Directories. In Windows OS, it is called folders.

Single Level Directory

Following is the information which is maintained in a directory:

  • Name The name which is displayed to the user.
  • Type: Type of the directory.
  • Position: Current next-read/write pointers.
  • Location: Location on the device where the file header is stored.
  • Size : Number of bytes, block, and words in the file.
  • Protection: Access control on read/write/execute/delete.
  • Usage: Time of creation, access, modification

File types- name, extension

File TypeUsual extensionFunction
Executableexe, com, bin or noneready-to-run machine- language program
Objectobj, ocomplied, machine language, not linked
Source codec. p, pas, 177, asm, a‭‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬source code in various languages‭‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬
Batchbat, shSeries of commands to be executed
Texttxt, doctextual data documents
Word processordoc,docs, tex, rrf, etc.various word-processor formats‭ ‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬‬
Librarylib, hlibraries of routines
Archivearc, zip, tarrelated files grouped into one file, sometimes compressed.

Summary:

  • A file is a collection of correlated information which is recorded on secondary or non-volatile storage like magnetic disks, optical disks, and tapes.
  • It provides I/O support for a variety of storage device types.
  • Files are stored on disk or other storage and do not disappear when a user logs off.
  • A File Structure needs to be predefined format in such a way that an operating system understands it.
  • File type refers to the ability of the operating system to differentiate different types of files like text files, binary, and source files.
  • Create find space on disk and make an entry in the directory.
  • Indexed Sequential Access method is based on simple sequential access
  • In Sequential Access method records are accessed in a certain pre-defined sequence
  • The random access method is also called direct random access
  • Three types of space allocation methods are:
    • Linked Allocation
    • Indexed Allocation
    • Contiguous Allocation
  • Information about files is maintained by Directories


Comments

Popular posts from this blog

Exokernel architecture

Exokernel architecture Most of us know what kernels are and how do they work to make programmers’ lives easier. But, how many of us know what exokernels are? I hope you will be able to get a brief introduction on this terminology through this blog. Let’s start with a brief introduction on kernel. What is a kernel? A kernel is the foundational layer of an operating system that functions at a basic level, communicating with hardware and managing resources, such as CPU and the memory. It works as an interface between the user application and the hardware. There   are two main types of kernel 1. Micro kernel 2. Monolithic Kernel 1.  Monolithic architecture 2.      Layerd archtecture . 3.       Virtual machine architecture 4.       Exokernel architecture 5.      Client server architecture   6.       Micro kernel architecture Now let’s head into our main focus. What is an Exokern...

Monolithic Architecture

  Monolithic Architecture Monolith means composed all in one piece. The  Monolithic  application describes a single-tiered  software  application in which different components combined into a single program from a single platform. Components can be: Authorization — responsible for authorizing a user Presentation — responsible for handling HTTP requests and responding with either HTML or JSON/XML (for web services APIs). Business logic — the application’s business logic. Database layer — data access objects responsible for accessing the database. Application integration — integration with other services (e.g. via messaging or REST API). Or integration with any other Data sources. Notification module — responsible for sending email notifications whenever needed. Example for Monolithic Approach Consider an example of Ecommerce application, that authorizes customer, takes an order, check products inventory, authorize payment and ships ordered products. This applicat...

Batch Processing Operating System

  Batch processing system ·           Batch processing is one of the oldest method    of running the programs ·           The computer in the past were very large in size and their I/O devices were very different from those that are used today. The job processing was not interactive as it is today. ·           The user did not interact directly with computer system.   ·           The process scheduling , memory management, file management and I/Omanagement functions are quite simple in batch processing system   1.         Process scheduling (i.e. allocation strategy for a processor is typically in order of their arrival i.e. first come first served(FCFS)basis.   2.         Memory management  is done by divi...

Classification of Operating System

  Classification of operating systems The operating systems may be classified into different types depending upon the nature of interaction between the user and his/her program. The various types of operating system are : 1.       single user operating system    2.        Multi user operating system   3.         Batch processing operating system 4.        Multi programming operating system   5.       Multi tasking operating system   6.         Multiprocessing operating system 7.         Time sharing operating system 8.       Real time system      Distributed system Multi threading operating system       Single user operating system ·          ...

Time Sharing System and its Requirements

  Time sharing  system ·           Time sharing refers to the allocation of computer resources in a time dependent fashion to several program simultaneously ·           A time sharing system has many user terminals that are connected to same computer simultaneously. Using these terminal, different users can work on a system at the same time ·           Thus, it uses multi programming with a special CPU scheduling among all the last one, and then again beginning from the first one ·           In time sharing system, the CPU time is divided among all the users on schedule basis. ·           It release the CPU under any of the following three conditions: 1.         When the allotted time slice expires. 2.    ...