Question
in C++, Write a program to simulate managing files on disk. Define the disk as a one-dimensional array disk of size numOfSectors*sizeOfSector, where sizeOfSector indicates
in C++, Write a program to simulate managing files on disk. Define the disk as a one-dimensional array disk of size numOfSectors*sizeOfSector, where sizeOfSector indicates the number of characters stored in one sector. Linked list structure will be used to keep the existing file list (their names and sizes), and to mark which sector is used by which file.
protocols to implement and commands:
F: format. formats file system on the disk, by initializing all of the tables that the file system relies on.
C f l data: This will create a file named f in the file system and write l characters of data on the disk. If the data is longer than l, the file will be made longer. If the data is shorter than l, some random character will be appended to data to fill the blanks. A return code should be printed out.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started