CMPE2300 – Lab01 - Defrag-o-matic In this lab you wil.docx - CMPE2300 – Lab01 Defrag-o-matic In this lab you will create a simulator to implement a

CMPE2300 – Lab01 - Defrag-o-matic In this lab you wil.docx

This preview shows page 1 - 8 out of 20 pages.

Image of page 1
CMPE2300 – Lab01 - Defrag-o-matic In this lab you will create a simulator to implement a file system defragmentation. Prior to SSDs, file systems benefited from ensuring files that were comprised of multiple disk partition units were allocated and adjacent on disk. This ensured minimum head movement for read/write of specific files. Our goal is to read in a text file formatted as one file allocation unit per row with a data component indicating the file name, a sequence number
Image of page 2
indicating part N ( of M ) units, and a next value indicating where the next unit resides. Once loaded and displayed the simulator will allow a basic defragmentation to be done, attempting to group files into adjacent allocation blocks. Program Specification Your project will require use of the CDrawer. You will need to define a structure to represent file allocation units, comprised of : • a string - representing the filename ( it will be one character for our simulation )
Image of page 3
• an integer - representing the sequence number of this allocation unit • an integer - representing the allocation unit of the next part of the file. Assumptions : A next value of -1 indicates that this allocation unit is empty A next value of -2 indicates that this is the last allocation unit of this file Any file system load will always have > 0 empty units Your UI will have 3 buttons : [Load FileSystem]
Image of page 4
[Verify FileSystem] [Defragment] / Toggling to disable defragmentation And a listbox for status output – population should always use insert so newest additions are first. Part I - Load FileSystem Your application will be allowed to create class level members for the following : • List of File Allocation Units ( structure ) • CDrawer
Image of page 5
• integer representing CDrawer File Allocation Scale ( not CDrawer scale ) • constant integer representing the maximum width for the CDrawer in pixels = 1000 Bind your [Load FileSystem] click event to a method in your form constructor. [Load FileSystem] Dynamically create an OpenFileDialog, and using System.IO.Path.GetFullPath and the appropriate Environment variable, set the Initial directory to the root source ( this will allow easy loading of the test files in your project ). Using System.IO.File.ReadAllLines(), read the user selected file in.
Image of page 6
For each line read, you may use split() to separate the 3 expected elements to be processed. Process as required to make and add a structure
Image of page 7
Image of page 8

You've reached the end of your free preview.

Want to read all 20 pages?

  • Fall '16
  • Christopher L. Litten, MA, Ph.D.

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors