Cleaning up after Code Warrior


Cleaning Up Your Project

As you can see in your project, a program may consist of source files and one or more libraries. In the course of writing and debugging a program, it may be necessary to compile the program dozens of times! Since all debugging is confined to the source files, recompiling the (unchanged) libraries each time would waste lots of time.

To avoid this inefficiency, once a file is compiled, a CodeWarrior project stores a copy of the compiled version called an object file. The Project -> Make command then recompiles any files that have been changed, and uses the existing object files of any files that have not been changed. By avoiding unnecessary recompilations, this saves lots of time.

Object files speed every Project -> Make after the first one, but they also consume disk space. You can see how much by looking at the Code and Data columns in your Mult.mcp window. To save disk space, the object files should be removed from a project any time you are done working on it.

To remove these files, choose Project -> Remove Object Code Click Ok in the dialog that appears, and then watch the Code and Data columns in your Mult.mcp window change to zeros as CodeWarrior removes the object files from the project!

Quitting CodeWarrior

To quit CodeWarrior, choose File -> Quit (or type Apple-q on your keyboard).

Cleaning Up Your Directory

The various files you have created take up valuable disk space and so we will remove the nonessential files from Mult. So long as we keep our source program, and the project files, we can easily rebuild our program from within CodeWarrior.

Navigate back to your labs folder and select (without opening) folder Mult. Then go to the File menu and choose File -> Get Info and a box will appear telling you (among other things) how much disk space Mult consumes (400 Kilobytes -- on our system).

Click the close box on the Mult info window. Then open Mult and then drag JBoundApp, the Mult Data folder, and AppClasses.jar to the Trash. Make sure you do not put Mult.java or Mult.mcp in the Trash. Empty the Trash and then navigate back to your labs folder. There, select (again, without opening) Mult and see how big it is now that we have deleted Debug. On our system, Mult is now just 90 Kbytes, which is a good savings.

Since a floppy disk only stores 1.4 Mbytes, the morale of the story is, always clean out your project folder before trying to save your work to a floppy disk.

Copying Your Work to a Floppy Disk

If you brought a floppy disk with you, you can save a copy of your work by navigating to the folder containing labs, selecting your labs folder, dragging it to the icon of your floppy disk, and dropping it there. When you drop the folder, you should hear the drive motor activate as the copy is performed and then stop. Note that this truly is a copy operation -- the original folder remains on your hard disk. To avoid having someone else plagiarize your work, you should then drag your original labs folder to the Trash and then empty the trash.

 


Back to the Lab


Back to the Table of Contents

Back to the Introduction


Copyright 2000 by Prentice Hall. All rights reserved.