Docsity

File Management - Operating Systems - Lecture Slides, Slides of Computer Science

Partial preview of the text

Download File Management - Operating Systems - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Operating Systems

Lecture 26:

File Management

Files

• Files are the central element to most

applications

• The File System is one of the most important

part of the OS to a user

• Desirable properties of files:

  • Long-term existence
  • Sharable between processes
  • Structure

File Management Systems

• Provides services to users and applications in

the use of files

  • The way a user or application accesses files

• Programmer does not need to develop file

management software

Objectives for a File

Management System

  • Meet the data management needs of the user
  • Guarantee that the data in the file are valid
  • Optimize performance
  • Provide I/O support for a variety of storage device

types

  • Minimize lost or destroyed data
  • Provide a standardized set of I/O interface routines

to user processes

  • Provide I/O support for multiple users (if needed)

Typical software organization

  1. Start I/O operations on a device
  2. Communicate at the lowest level directly with peripheral devices or their controllers or channels

Typical software organization

  1. Deals with blocks of data that are exchanged with disk or tape systems
  2. Does not understand the content of the data or the structure of the files involved

Typical software organization

  1. Enables users and applications to access records
  2. Provides general- purpose record I/O capability: maintains basic data about files

Typical software organization

Access method varies depending on the ways to access and process data for the device

File Organization

• File Management Referring to the logical

structure of records

  • Physical organization discussed later

• Determined by the way in which files are

accessed

• [Terminology: fields, records, files, database]

Criteria for File Organization

• Important criteria include:

  • Short access time
  • Ease of update
  • Economy of storage
  • Simple maintenance
  • Reliability

• Priority will differ depending on the use (e.g.

read-only CD vs Hard Drive)

  • Some may even conflict

The Pile

16

• Data are collected in the order they

arrive

  • No structure

• Purpose is to accumulate a mass of data

and save it

• Records may have different fields

• Record access is by exhaustive search

• Used when data collected prior to

processing or hard to organize

The Sequential File

17

  • Fixed format used for records
  • Records are the same length
  • All fields the same (order and length)
  • Field names and lengths are

attributes of the file

  • Key field
    • Uniquely identifies the record
    • Records are stored in key sequence
  • Optimum for applications that

process all records (billing or payroll)

Indexed File

• Uses multiple indexes for

different key fields

  • May contain an exhaustive index

that contains one entry for every

record in the main file

  • May contain a partial index

• No sequentiality

• When a new record is added to

the main file, all of the index files

must be updated.

Direct (hashed) File

• Access directly any block of a known address.

• The Direct or Hashed File

  • Directly access a block at a known address
  • Key field required for each record

• Direct files are often used where:

  • very rapid access is required,
  • fixed length records are used, and
  • records are always accessed one at a time.