[prev] 31 [next]

Single-file DBMS (cont)

Allocating space in Unix files is easy:
  • simply seek to the place you want and write the data
  • if nothing there already, data is appended to the file
  • if something there already, it gets overwritten
If the seek goes way beyond the end of the file:
  • Unix does not (yet) allocate disk space for the "hole"
  • allocates disk storage only when data is written there
With the above, a disk/file manager is easy to implement.