title: Emulating a Paged File System in C++ using fstream objects
body: <p>I need to emulate a paged file system in C++. Need to store multiple tuples in a page(block of a file) with a directory at the end of each page pointing to the offset of each tuple on the page. I also need to store variable length attributes in the tuples. Would using an STL container and serializing it to disk be the best way forward?</p>
  
  <p>Thanks</p>
  
  <p>A few more details about what I'm looking for-
  I have created a file - say employee.day with blocks of 4096bytes.
  I need to store tuples in each block with a directory at the end of each block that stores the address and offset of each tuple.
  Each time I insert a new tuple I need to find a page with enough free space and insert it into the page and update the directory at the end of the page.
  My tuples can be of variable length, so I also need to store the length of the tuples in the file. I have the schema of the table loaded into a vector during the operation of the program. I'm looking for some ideas on how to implement the storing of tuples into the page using just the read and write operations in fstream,</p>