placing file record on disk

9
PLACING FILE RECORDS ON DISK By Princy.c.c

Upload: vsunny488

Post on 11-Apr-2015

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: placing file record on disk

PLACING FILE RECORDS

ON DISK

By

Princy.c.c

Page 2: placing file record on disk

RECORD :

It is the collection of related data values and items.It describes the entities and attributes.

eg : Employee record .

RECORD TYPES :

It is the collection of field names and their corresponding data types.

A data type specifies the types of values of a field.

Page 3: placing file record on disk

FILE: It is a sequence of records. There are two types of files depending upon the size 1. Fixed length record 2. Variable length record

Fixed length record : Every record in a file are same size.Variable length record : Different records in a file are different size.

:

Page 4: placing file record on disk

• File become variable length record depends

1.The file records are same record type but one or more fields are different size.

2. File records are same record type but one or more field have multiple values for individual record.

3. Files are same record type but some fields are optional.

4. Files contain records of different record types and varying length.

Page 5: placing file record on disk

RECORD BLOCKS

• Records of file are stored in disk blocks.Each block contain numerous records.

bfr = floor (B/R) records per block.

unused space = B-(bfr*R)bytes

where bfr is the blocking factor.

B is the size of block b.

R is the size of fixed length records.

Page 6: placing file record on disk

SPANNED Vs UNSPANNED

Spanned :

It stores one part of a record in one block and the rest in the other .

Unspanned :

The records are not allow to cross block boundries. Each block may contain different number of records.

number of blocks for r records

b = ceil (r/bfr)blocks

Page 7: placing file record on disk

ALLOCATING FILE BLOCKS ON DISK

There are three types allocation 1. Contiguous allocation 2. Linked allocation 3. Indexed allocation Contiguous allocation The file blocks are allocated to consecutive disk blocks. Linked allocation Each file block contain a pointer to the next block. Indexed allocation One or more index blocks contain pointes to the actual

blocks.

Page 8: placing file record on disk

FILE HEADER

• It contain information about a file that is needed by the system programs that access the file records.

• It also include the information to determine the disk

address,record format of a file.

Page 9: placing file record on disk