File Management in Operating Systems: A Comprehensive Guide, Essays (university) of Operating Systems

Operating System File Management

Typology: Essays (university)

2019/2020

Uploaded on 06/08/2020

rasika-ransing
rasika-ransing 🇮🇳

4

(1)

1 document

1 / 73

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Chapter 12
File Management
Eighth Edition
By William Stallings
Operating
Systems:
Internals
and Design
Principles
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49

Partial preview of the text

Download File Management in Operating Systems: A Comprehensive Guide and more Essays (university) Operating Systems in PDF only on Docsity!

Chapter 12

File Management

Eighth Edition By William Stallings

Operating

Systems:

Internals

and Design

Principles

Files

 Data collections created by users

 The File System is one of the most important parts of the OS to a user

 Desirable properties of files:

Long-term existence

  • files are stored on disk or other secondary storage and do not disappear when a user logs off

Sharable between processes

  • files have names and can have associated access permissions that permit controlled sharing

Structure

  • files can be organized into hierarchical or more complex structure to reflect the relationships among files

File Structure

Four terms are

commonly used when

discussing files:

Field Record File Database

Structure Terms

Field

 basic element of data

 contains a single value

 fixed or variable length

File

 collection of related fields that can be treated as a unit by some application program

 fixed or variable length

Record

Database

 collection of similar records  treated as a single entity  may be referenced by name  access control restrictions usually apply at the file level

 collection of related data

 relationships among elements of data are explicit

 designed for use by a number of different applications

 consists of one or more types of files

Minimal User Requirements

Each user:

1 •^ should be able to create, delete, read, write and modify files

2 • may have controlled access to other users’ files

3 •^ may control what type of accesses are allowed to the files

4 •^ should be able to restructure the files in a form appropriate to the problem

5 •^ should be able to move data between files

6 •^ should be able to back up and recover files in case of damage

7 •^ should be able to access his or her files by name rather than by numeric identifier

Indexed Pile Sequential Sequential

Logical I/O

Basic I/O Supervisor

Figure 12.1 File System Software Architecture

Basic File System

Disk Device Driver Tape Device Driver

Indexed Hashed

User Program

Basic File System

 Also referred to as the physical I/O level

 Primary interface with the environment outside the computer

system

 Deals with blocks of data that are exchanged with disk or tape

systems

 Concerned with the placement of blocks on the secondary storage

device

 Concerned with buffering blocks in main memory

 Considered part of the operating system

Basic I/O Supervisor

 Responsible for all file I/O initiation and termination

 Control structures that deal with device I/O, scheduling, and file

status are maintained

 Selects the device on which I/O is to be performed

 Concerned with scheduling disk and tape accesses to optimize

performance

 I/O buffers are assigned and secondary memory is allocated at this

level

 Part of the operating system

Access Method

 Level of the file system closest to the user

 Provides a standard interface between applications and the file

systems and devices that hold the data

 Different access methods reflect different file structures and

different ways of accessing and processing the data

Directory management

Access method (^) Blocking Disk scheduling

File allocation

File Structure

Records

File management concerns

Figure 12.2 Elements of File Management

Operating system concerns

Physical blocks in main memory buffers

Physical blocks in secondary storage (disk)

User access control

User & program comands (^) Operation, File name

Free storage management

File manipulation functions

I/O

File Organization Types

Five of the common file organizations are:

The pile

The sequential file

The indexed indexed fileThe^ sequential file

The direct, or hashed, file

(a) Pile File

(c) Indexed Sequential File

(d) Indexed File

Figure 12.3 Common File Organizations

Variable-length recordsVariable set of fields Chronological order (b) Sequential File

Fixed-length recordsFixed set of fields in fixed order Sequential order based on key field

Main File

OverflowFile

Indexlevels

Exhaustiveindex Exhaustiveindex Partialindex

(variable-length records)Primary File

Index 12

n

The Sequential

File

 Most common form of file

structure

 A fixed format is used for

records

 Key field uniquely identifies

the record

 Typically used in batch

applications

 Only organization that is

easily stored on tape as well

(a) Pile File as disk

ble-length records
ble set of fields
nological order

(b) Sequential File

Fixed-length records
Fixed set of fields in fixed order
Sequential order based on key field
Exhaustive Exhaustive Partial

Indexed

Sequential File

 Adds an index to the file to support random access

 Adds an overflow file

 Greatly reduces the time required to access a single record

 Multiple levels of indexing can be used to provide greater efficiency in access

(a) Pile File

(c) Indexed Sequential File

Main File

Overflow File

Index levels Index

1

2

n