Computer Science Related Others Courses AvailableThe Best Codder.blogspot.com

File Systems In Operating System

File system is the part of the operating system which is responsible for file management. It provides a mechanism to store the data and access to the

 

File Systems

File system is the part of the operating system which is responsible for file management. It provides a mechanism to store the data and access to the file contents including data and programs. Some Operating systems treats everything as a file for example Ubuntu.

A file is a collection of related information that is recorded on secondary storage. Or file is a collection of logically related entities. From user’s perspective a file is the smallest allotment of logical secondary storage. 

The File system takes care of the following issues

  • File Structure
  • We have seen various data structures in which the file can be stored. The task of the file system is to maintain an optimal file structure.

  • Recovering Free space
  • Whenever a file gets deleted from the hard disk, there is a free space created in the disk. There can be many such spaces which need to be recovered in order to reallocate them to other files.

  • disk space assignment to the files
  • The major concern about the file is deciding where to store the files on the hard disk. There are various disks scheduling algorithm which will be covered later in this tutorial.

  • tracking data location
  • A File may or may not be stored within only one block. It can be stored in the non contiguous blocks on the disk. We need to keep track of all the blocks on which the part of the files reside.

The name  of the file is divided into two parts as shown below:

  • name
  • extension, separated by a period.

Files attributes and its operations:
 

AttributesTypesOperations
NameDocCreate
TypeExeOpen
SizeJpgRead
Creation DataXisWrite
AuthorCAppend
Last ModifiedJavaTruncate
protectionclassDelete
  Close

 

File typeUsual extensionFunction
Executableexe, com, binRead to run machine language program
Objectobj, oCompiled, machine language not linked
Source CodeC, java, pas, asm, aSource code in various languages
Batchbat, shCommands to the command interpreter
Texttxt, docTextual data, documents
Word Processorwp, tex, rrf, docVarious word processor formats
Archivearc, zip, tarRelated files grouped into one compressed file
Multimediampeg, mov, rmFor containing audio/video information
Markupxml, html, texIt is the textual data and documents
Librarylib, a ,so, dllIt contains libraries of routines for programmers
Print or Viewgif, pdf, jpgIt is a format for printing or viewing a ASCII or binary file.

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

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.

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.

Post a Comment

© Operating System . The Best Codder All rights reserved. Distributed by