Sunday, June 17, 2012

Operating Systems Day 08 File Manager

Files are made up of records. Records consist of fields.



File Manager is also called the file management system. It is software responsible for creating, deleting, modifying and controlling access to files. It also manages the resources used by the files.

File Manager performs its functions in collaboration with the Device Manager.

Responsibilities of File Manager include the following.


1. File storage tracking

  • Determine where and how files are stored

2. Implement storage management policies

  • Efficiently use available storage space
  • Provide efficient file access

3. File allocation: open() system call

  • Record file use

4. File access: read() system call

  • Accesses and returns data and tracks position in file

5. File de-allocation: close() system call

  • Return file to storage and make available for others

Field is a group of related bytes that can be identified by the user with a name, type, and size.

Record is a group of related fields.

File is a group of related records that contains information used by specific application programs to generate reports.

Database is a group of related files that are interconnected at various levels to give users flexibility of access to the stored data.

A program file contains instructions and a data file contains data.

Directories are special files with listings of filenames and their attributes.

Record format


Within each file, records are all presumed to have the same format. They may be (1) fixed length or (2) variable length.

whereas the variable-length formats are used in files accessed sequentially (text files, program files), or in files that use an index to access records.

Fixed-length record
  • Defined number of characters
  • Direct access is easy - use a formula to calculate byte position
  • Record size is critical
    • With fixed length fields, long fields are truncated
  • Ideal for simple data files
Variable-length record
  • Direct access: difficult
  • No empty storage space and no character truncation
  • File descriptor stores record format
  • Used with files accessed sequentially - text or program files
  • Used for files with index to access records
  • Cannot be used with Random (Direct) files
References
  1. McHoes, A., & Flynn, I.M. (2008). Understanding operating systems (5th ed.). CENGAGE Learning.
  2. Melbourne Institute of Technology (Semester 1, 2012). BN104 Operating Systems Lecture Notes.

No comments:

Post a Comment

Mounting USB drives in Windows Subsystem for Linux

Windows Subsystem for Linux can use (mount): SD card USB drives CD drives (CDFS) Network drives UNC paths Local storage / drives Drives form...