Re: project 5


[ Follow Ups ] [ Post Followup ] [ CS2604 Discussion WWWBoard ] [ FAQ ]

Posted by hussein on August 08, 1999 at 17:01:06:

In Reply to: project 5 posted by B on August 08, 1999 at 13:23:18:

: What does the "union" structure in the Node class do exactly?

read up your C textbook ... union allows two variables to share the same memory ... that way you can overlap the memory requirements for the file pointer and memory pointer since they are never both used at the same time ...

: In the spec, it says we must change the memory pointers to file pointers. Is there an example in the sample code on how this is done?

yes. thats exactly what the sample code does, in the SaveList (i think) function.

: Should our entire directory tree should be saved to
: one file?

yes.

: Why does the SaveList function return an integer?

it returns the file pointer to the head of the linked list. its not necessary for the sample program, but in order to extend this to work with trees, you may need it (just as Build returned a Node * in project 3)

: When the program executes, should it immediately
: read in the directory tree from the hard drive,
: build the tree in memory, and write the tree back
: to disk before the user is prompted with a question
: about searching?

that depends on your interface.

if you ask the user for a directory to start in, you should then read it in and save it to disk ... you can even give the user options in terms of which file to save it in ... and which file to search through (with appropriate defaults of course).

: And when the user does enter a directory to search,
: should this directory tree that is now stored in a
: file on the hard drive be opened, searched, and
: closed again each time?

yes ... the disk search function MUST NOT use the memory-based tree structure - if it does, you get 0 points for that part of the assignment ...

---

hussein


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS2604 Discussion WWWBoard ] [ FAQ ]