PLACING FILE RECORDSON DISK Shashwat Shriparv email@example.com InfinitySoft
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.
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. :
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.
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.
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
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.
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.