operating-systems file-management
Definition
File Organisation
File organisation is the logical structure of records within a file and the method used to access them. The choice depends on the application and required access speed.
Organisations
Unstructured Byte Stream
File treated as a stream of bytes with no internal record structure. Standard in Unix and modern Windows; interpretation left to the application.
Pile
Records stored in chronological order. Variable-length records with variable fields. Requires linear search (slow). Useful for logs or temporary data.
Sequential File
Fixed-format records ordered by a key field. Efficient for full-file processing; searching faster than pile (binary search) but still requires multiple disk accesses. Insertion difficult — often requires an overflow file and periodic reorganisation.
Indexed Sequential File
Sequential file with an index for direct access. Index contains key and pointer to block start. Uses overflow file for new insertions without shifting records.
Indexed File
Multiple indexes, one per searchable field. Primary records not necessarily ordered; indexes provide logical ordering. Common in database systems for high-speed multi-attribute lookup.
Hash (Direct) File
Uses a hash function on the key to determine physical address. Provides direct access. Collisions handled via overflow file or chaining. Ideal when direct access is primary requirement.