PDA

View Full Version : simulator for managing of files on a disk.


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.

Fou-Lu
03-30-2009, 12:57 PM
Given you're criteria for note 5, yep its supposed to be in Java.

This is clearly a homework assignment. We cannot do you're work for you, but we can answer any specific questions. Do you have any?

Gox
03-31-2009, 02:03 AM
You know, maybe we should take posts in the above form (OP's post); Where nothing more than the assignment description is given and move them all into a single thread. That way when the occasional person who actually wants to learn to program posts a thread like "I want to learn give me some projects to try" we can just point them to the thread with a list of other peoples assignment questions.