vipula
03-30-2009, 11:30 AM
How to create this disk simulator?can u do this using java?
Disk space is a valuable resource which should be used sparingly. When a file is brought in to a
computer it saves all the data contained in to the disk. Managing files in a disk is a interesting
task. Initially the all the available disk space is in kept in a pool which can be represented by a
linked list (the space does not have to be contiguous). When a file is saved the space is taken
from the pool and the allocation is maintained at the files end with another linked list
You are required to implement a simulator for managing of files on a disk. Please follow the
guidelines given below.
Define the disk as an array of size numberOfSectors*sizeOfSector, sizeOfSector refers
to the amount of characters stored in one sector. As for this assignment we will resolve to
have 100 sectors with each holding 4 characters.
The structure of the linked list node should be identified and it does not have to be the
same for both the lists
Implement the methods to save and delete files.
Since the allocated sectors might not be contiguous (this phenomenon is known as
fragmentation ) retrieval of the file from the disk can be very badly affected. You are
required to write method which would remove file fragmentation from the disk.
Coding Constraints
Name of the Java class should be FileManagementSim
The array should be named disk and the two linked lists should be named pool and file
The method signatures of the above operations should be save(String filename) ,
delete(String filename) and defragment(). You can have any number of methods you
want but these three methods with there respective signatures are mandatory.
The complete source code should be written in a single file . Once you have tested your
program remove the main method from it before submitting.
Disk space is a valuable resource which should be used sparingly. When a file is brought in to a
computer it saves all the data contained in to the disk. Managing files in a disk is a interesting
task. Initially the all the available disk space is in kept in a pool which can be represented by a
linked list (the space does not have to be contiguous). When a file is saved the space is taken
from the pool and the allocation is maintained at the files end with another linked list
You are required to implement a simulator for managing of files on a disk. Please follow the
guidelines given below.
Define the disk as an array of size numberOfSectors*sizeOfSector, sizeOfSector refers
to the amount of characters stored in one sector. As for this assignment we will resolve to
have 100 sectors with each holding 4 characters.
The structure of the linked list node should be identified and it does not have to be the
same for both the lists
Implement the methods to save and delete files.
Since the allocated sectors might not be contiguous (this phenomenon is known as
fragmentation ) retrieval of the file from the disk can be very badly affected. You are
required to write method which would remove file fragmentation from the disk.
Coding Constraints
Name of the Java class should be FileManagementSim
The array should be named disk and the two linked lists should be named pool and file
The method signatures of the above operations should be save(String filename) ,
delete(String filename) and defragment(). You can have any number of methods you
want but these three methods with there respective signatures are mandatory.
The complete source code should be written in a single file . Once you have tested your
program remove the main method from it before submitting.