Unit 6 File Organization - Prof Gauri Y Gunjal
Unit 6 File Organization - Prof Gauri Y Gunjal
FILE ORGANIZATION
1. There may be a program whose size is larger than the available memory
or there may be a program, which requires data that cannot fit in main
memory at once.
2. Main memory loses the data once the program is terminated or the
power supply is switched off and it may be required to store data from
one execution of a program to next.
■ logical organization
◻ the abstract way that the computer program is able to access
the data
◻ use of logical structures (e.g. linked lists)
■ physical organization
◻ the actual physical structure of data in memory
◻ i.e. what the sequence of bits look like in memory
■ Fixed-length
◻ each record is a set size
◻ can be used with direct access file organization
■ access based on math calculations, so size must be fixed in length
■ Variable-length
◻ each record is a variable size
◻ can be used with sequential file organization
■ access is all indexed, so size does not matter
cp = current position
■ Sequential file –
records can only be accessed sequentially,
one after another, from beginning to end.
• Unlike sequential file, records in this file organization are not stored
sequentially.
• Instead, each record is mapped to an address on disk on the basis of
its key value. One such technique for this mapping of record to an
address is called hashing.
■ Inverted file –
you can have more than one index, each with a different key.
Data entries
Data entries
(Index File)
(Data file)
• Alternative 1 always
Jones, 40, 6003
44
50
smaller;