Monday, 23 February 2015

F452 File handling

Serial file:

  • Data is stored in the order that it is added.
  • This is known as 'appending' the data.

Sequential file:

  • Data is stored according to a key field.
  • When writing data to a sequential file all subsequent records need to be moved.
  • File modes:
    • -Append
    • -Create
    • -CreateNew
    • -OpenOrCreate
    • -Read
    • -ReadWrite
    • -Write

Indexed sequential file:

  • Data is arranged according to a key field but uses an index which can find records directly.

Random files:

  • Allow data to be stored anywhere in a dedicated section of a disk.
  • A hash algorithm (calculation) is performed on a field in the record to be stored.

Size estimation:

  1.  Determine the size in Bytes of each field.
  2.  Add the field sizes.
  3.  Multiply by number of records.
  4.  Add 10% to the result for additional storage/ overhead.

No comments:

Post a Comment