write a program to simulate managing files on disk
How to 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. A pool of available sectors is kept in a linked list sectors of three-field structures: two fields to indicate range of available sectors and one next field. Files are kept in a linked list files of four-field structures: file name,the number of characters in the file, reference to a linked list of sectors where the contents of the file can be found, and the next field.
In the first part, implement methods to save and delete files. Saving files requires claiming a sufficient number of sectors from pool,if available. The sectors may not be contiguous, so the linked list assigned to the file may contain several nodes. Then the contents of the file have to be written to the sectors assigned to the file. Deletion of a file only requires removing the nodes corresponding with this file(one from files and the rest from its own linked list of sectors) and transferring the sectors assigned to this file back to pool. No changes are made in disk.
If some one know how to do this please help me. Thank you
<Data Structures And Algorithms in Java By Adam Drozdek page 125>