PLEASE NOTE: the upgrades to this server,, have not yet been completed.
Hopefully the changes will be completed on THURSDAY 8th December.
Web-based programs, such as csmarks, cssubmit, and the help fora, will be unavailable at some time on Thursday 8th.
  It's UWAweek 49


This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

Displaying selected article
Showing 1 of 919 articles.
Currently 7 other people reading this forum.

 UWA week 40 (2nd semester, week 10) ↓
SVG not supported

Login to reply

4:13pm Wed 5th Oct, Christopher M.

> The first command invocation is: ./trove [-f trovefile] word > 1. If the optional 'trovefile' is not provided, then our program should go through out entire directory (starting from the root) and then list the names of the files where the path contains the 'word' > 2. If there is a trovefile provided, then our program should not go through all directories, but only look at the pathnames specified in the trovefile. But one thing to look out for is that the files in the trovefile may have been deleted, so we need to crosscheck each file with our actual directory to see if it still exists.
Mostly, NO. If *any* request to run trove has the -f option, then the following filename is the one to read/write the indexed information. If the the -f option is not specified, then the deafult file "/tmp/trove" is used.
> The second command invocation is: ./trove [-f trovefile] [-b | -r | -u] [-l length] filelist > 1. Sorry for this question but I'm very confused about what a trovefile actually is. If we were to open the trovefile, what would we see? Our goal of the trovefile is to make it easy for someone to provide a word, and for us to find file-paths that contain that word, right?
The contents of trove-file will have any format that you design/choose. Whatevr you write to your trove-file is what you will see when you read your trove-file in. Your trove program will not be able to read in a trove-file created by my trove program, because you do not know the format.
> 2. What do you mean by 'the trove-file does not have to be a text-file'. Doesn't our program have to write down the indexes in a file on disk? Or do you mean it just doesn't have to have a .txt extension?
It can be, but does not have to be, a text-file. As discussed in Lecture-8. The presence or absence of any extension (such as ".txt") does not affect the format/contents of a file.
> 3. How does the input 'filelist' work? Will it just be a string of files separated by spaces like .trove "path1 path2 path3 dir1 dir2" ?
Please re-read the project sheet - "A filelist is a sequence of one-or-more filenames or directory names." If you 'wrap' them up in double quotes, then you are making them one big single argument. If the filelist has, say, 5 elements, then you need to pass all 5 elements as 5 arguments to your trove program.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  1:17AM Sep 14 2022
Privacy policy