Sophia-Avakas / Record-based-File-Management-System

A record-based file manager is designed and implemented from scratch to perform file I/O operations in C++ on Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Record-based File Management System


I implement a paged file component and a record-based file manager from scratch to provide methods for managing files and pages in files.

The paged file component provides methods to create, destroy, open, and close paged files, to read and write a specific page of a given file, and to add pages to a given file. We use a FileHandle Class to access to the pages of an open file, and maintain counters for each of the I/O-related operations. The counter values binds to a file, and they need to be persistent between multiple file open and close operations of the PagedFileManager. So I need to store the counter values physically in a file. In my implementation, I reserve the file's first page as a hidden page to store the counter values as well as the number of pages.

The record manager implements record-based operations such as inserting, updating, deleting, and reading records. First, I designed the record format with variable length to save space, and designed the page format with slot directory at the end to locate record quickly. Since the input data API is not the same as my design, I need to map each byte from the source to my record, and then insert it into the last page.

About

A record-based file manager is designed and implemented from scratch to perform file I/O operations in C++ on Linux

License:MIT License


Languages

Language:C++ 100.0%