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 249 tagged articles
Showing 249 of 919 articles.
Currently 5 other people reading this forum.

 UWA week 43 (2nd semester, study break) ↓
SVG not supported 3:03am Sat 29th Oct, Christopher M.

ANONYMOUS wrote There shouldn't a problem, because the project webpage says "You may leave 'debug printing' in your submitted program, but all debug printing should be indented with one-or-more space or tab characters." (and glad to hear that someone...

SVG not supported 11:59pm Fri 28th Oct, ANONYMOUS

ANONYMOUS wrote Sorry I don't know why but the actual post is showing only one space before the debugging statement but there's supposed to 4 spaces preceding it. printf(" searching for ' s' n", wanted); 4 spaces 1 tab in my text editor ...

SVG not supported 11:56pm Fri 28th Oct, ANONYMOUS

Hello, I've completed submitted my project-2 ages ago, but I just had a concerning thought regarding my debugging statements while examining the sample solution code. So for my debugging statements, I did printf(" searching for ' s' n", wanted); ...

SVG not supported 4:58am Fri 28th Oct, Christopher M.

Now that all nearly all students with Special Considerations and UAAPs appear to have submitted their 2nd projects, you may download the sample solution's code from https units CITS2002 projects PLEAS...

 UWA week 42 (2nd semester, week 12) ↓
SVG not supported 4:20pm Sun 23rd Oct, Christopher M.

ANONYMOUS wrote Your question indicates that you are trying to compress things using C code from a library. The project description says that the compression decompression must be performed by the gzip and zcat utility programs.

SVG not supported 4:12pm Sun 23rd Oct, ANONYMOUS

Can I add -lz before the -o in the Makefile to do the compressing?Thank you

SVG not supported 4:22pm Fri 21st Oct, Christopher M.

Thanks Alan, will try to find time to fix this soon for students still reliant on it. I hope the intended operation is, however, clear.

SVG not supported 2:02pm Fri 21st Oct, Alan Z.

Was doing some testing against the sample solution and I believe there may be a bug. Here are the steps to reproduce it 1. Build trove with . 2. Search for the word loop , which comes up with baseball , src estimatecron-sample.c and rotate.c 3...

SVG not supported 12:37pm Fri 21st Oct, Christopher M.

ANONYMOUS wrote If little success with Google, https run help2002?opt St search garbage may help.

SVG not supported 12:27pm Fri 21st Oct, ANONYMOUS

Hi Just wanted to follow up on this. My program sometimes has the error 'gzip tmp trove decompression OK, trailing garbage ignored' and sometimes doesn't. I have tried unlinking the file in various places but it doesn't seem to help. I can't find...

SVG not supported 7:54pm Thu 20th Oct, Cohen R.

That's about what I was thinking, thanks for the response

SVG not supported 6:07pm Thu 20th Oct, Leo G.

If you stored everything in one big string, why not read character by character and stop whenever you encounter ' n'?

SVG not supported 5:58pm Thu 20th Oct, Cohen R.

Hello, I have been struggling to figure out how to read a string line by line. Everything I have found is about reading files not variables. I want to use something like fgets but fgets needs a file pointer as input. Is there a way use fgets for a loc...

SVG not supported 5:35pm Thu 20th Oct, Christopher M.

Stated some where previously, can't find it - only use the -l option with -b and -u.

SVG not supported 5:31pm Thu 20th Oct, Kyle C.

Hi Chris, At the moment I currently have the -r command removing the absolute paths from the trove file based on the command arguments that are passed in through the terminal, However I was just wondering if this is passed with say for example . trove ...

SVG not supported 5:28pm Thu 20th Oct, Christopher M.

ANONYMOUS wrote What does the sample solution do?

SVG not supported 5:27pm Thu 20th Oct, Christopher M.

Unsure what you're meaning by "...being parsed". If an existing trove-file includes information about a particular absolute pathname, then the -r option should remove that absolute path from the trove-file, and the modified trove-file should no longer...

SVG not supported 5:26pm Thu 20th Oct, ANONYMOUS

If filelist provide some files that trovefile doesn't have, does -r report an error, or just delete the files provided in filelist that appear in trovefile?Thank you

SVG not supported 5:23pm Thu 20th Oct, Christopher M.

ANONYMOUS wrote I cannot understand the problem you're describing. What do you mean opendir() takes a pointer?? Even the following code, which doesn't do anything useful, doesn't crash include dirent.h int main(int argc, char argv ) ...

SVG not supported 5:13pm Thu 20th Oct, Christopher M.

ANONYMOUS wrote I'm unsure what you believe that you've achieved, or why it may have been difficult. Serious question?? The trove-file is always named tmp trove, unless the -f option requests a different name. tmp is a directory on your computer,...

SVG not supported 5:08pm Thu 20th Oct, ANONYMOUS

I take this back - it is printing an error message 'gzip tmp trove decompression OK, trailing garbage ignored'. But I'm still confused about how to truncate and unlink the file. And also, when it needs to be done - like is it after calling execl(" ...

SVG not supported 5:01pm Thu 20th Oct, ANONYMOUS

Hi In a previous help forum post, you mentioned that we need to either truncate or unlink() our files. Is this during the gzip or the zcat process? I don't believe my program currently does either one, but it seems to work okay without any error messag...

SVG not supported 4:04pm Thu 20th Oct, Gianni S.

Just wondering something about the 2nd project... The -r argument is said to "...remove all of their information from the trove-file." Is that a hard requirement? My solution currently just stops it from being parsed. Do I have to zero out the path to ...

SVG not supported 3:28pm Thu 20th Oct, ANONYMOUS

Hello Chris, My project partner and I were currently under the assumption that when calling the update function, the filenames given in the filelist are the only files that have been updated since the initial trovefile was built and that the contents ...

SVG not supported 2:11pm Thu 20th Oct, ANONYMOUS

after playing around a bit, it seems that the value of the pointer, which points to the data in the array, gets taken by the opendir() (when opendir() assigns a pointer to it's dir struct, the newly assigned pointer takes the value of a pointer alrea...

SVG not supported 12:44pm Thu 20th Oct, ANONYMOUS

hello, just for clarifications, would it be valid to build a trovefile with no content in it? Is it possible to update an empty trove file(for example adding a new file content into an empty trove file)? in the sample solution, its impossible to build...

SVG not supported 12:01pm Thu 20th Oct, ANONYMOUS

Hello Chris, I have found a way to name the default trove file exactly tmp trove.. Will i be penalised since the project sheet says the NAME of the trove file is tmp trove or do i still have to store the trove file in the tmp directory ((Not tryna ...

SVG not supported 11:24am Thu 20th Oct, Christopher M.

ANONYMOUS wrote This is the wrong way around. Should be dup2(fd1, 1); close(fd1);

SVG not supported 11:21am Thu 20th Oct, ANONYMOUS

Thank you, I think I understand it a bit more now. The gzip process will automatically read from standard input, which is fd 0. So then, gzip will give its output to standard output, which is fd 1. But I'm unsure how to translate this to a file. I...

SVG not supported 11:14am Thu 20th Oct, Christopher M.

ANONYMOUS wrote Can have only one of -b, -r, or -u. What does the sample solution do?

SVG not supported 11:12am Thu 20th Oct, ANONYMOUS

Hi, Apologies if this has already been asked, I could not find it on the forum. If two options are provided like -b -r, do we exit failure or only take into account the first mentioned? Thanks

SVG not supported 11:10am Thu 20th Oct, ANONYMOUS

Hi, Apologies if this has already been asked I couldn't find it in the forum. If two options are provided like -b and -r, do we exit failure or do we only take into account the first option? Thanks

SVG not supported 3:32am Thu 20th Oct, Christopher M.

ANONYMOUS wrote Once your trove process is connected to gzip's standard input with a pipe, you can write anything to the pipe and gzip will read it. The first 3 lines look correct (and familiar -) but the second parameter to execl() is incorre...

SVG not supported 3:17am Thu 20th Oct, Christopher M.

ANONYMOUS wrote About 20 of the project. The concepts of forking execing a new process, creating communicating through pipes, and redirecting I O to from files are all important concepts being assessed.

SVG not supported 3:10am Thu 20th Oct, Christopher M.

ANONYMOUS wrote opendir() is a library function which is at liberty to dynamically allocate it own memory (which will be deallocated by closedir()) to perform its work. An obvious case is seen when opendir() returns a pointer to (an opaque) DIR stru...

SVG not supported 3:03am Thu 20th Oct, Christopher M.

ANONYMOUS wrote Consider updating as a combination of removing and building. If you're asked to update a trove-file with about file 'X', then remove all previous knowledge of (the old) file 'X', and then add knowledge about the current file 'X'.

SVG not supported 3:00am Thu 20th Oct, Christopher M.

Great to hear you solved it. Yes, you should either truncate or remove ( unlink() ) an existing trove-file.

SVG not supported 2:59am Thu 20th Oct, Christopher M.

The video has no audio.

SVG not supported 1:08am Thu 20th Oct, ANONYMOUS

Hi Chris, on that note, and if you don't mind me asking, how many marks will I be missing out on if I fail to implement gzip and zcat in my final submission? Ofcourse, I'll try my best to complete the project and meet all the requirements, but the las...

SVG not supported 9:49pm Wed 19th Oct, ANONYMOUS

Here's an interesting one. I have a couple of arrays of pointers holding some filenames and directory names, and i noticed that the information they're pointing got randomly set to 0 (as in, when printed, the strings didn't print anything). After playi...

SVG not supported 9:00pm Wed 19th Oct, ANONYMOUS

I believe its to do with if a file has changed since the trovefile has built. For example, if a text file has a word removed from it, you would need to update the trovefile to show that the word doesn't exist in that file anymore.

SVG not supported 8:21pm Wed 19th Oct, ANONYMOUS

For the -u flag, should the old information in the Trove file that does not exist in the filelist be discarded? Or does the "updating" in the instruction just mean replacing that trovefile with a new one built from the filelist.

SVG not supported 8:21pm Wed 19th Oct, Hai L.

Solved - Whoops, turns out that the error was a byproduct of not truncating the file before writing to it. The trailing garbage was probably remnants of past writes that weren't properly removed.

SVG not supported 7:57pm Wed 19th Oct, ANONYMOUS

Hello there, just wondering about the trove sample video? It doesn't seem to have any sound no matter what browser I open it in, not sure if it's even supposed to have sound, but just wanted to make sure. cheers.

SVG not supported 6:24pm Wed 19th Oct, Hai L.

Hi Chris, Me and my partner are noticing an output from gzip during the zcat decompression that states 'decompression OK, trailing garbage ignored'. The program otherwise runs normally and this output does not affect the operation of the program (as f...

SVG not supported 4:27pm Wed 19th Oct, Christopher M.

You first compile all C files with cc's -c option, then link the object files together with cc 's -o option. Lecture-17.

SVG not supported 4:21pm Wed 19th Oct, Christopher M.

ANONYMOUS wrote I fully appreciate your concerns and the fact that you may be struggling with the project; we see it every semester, particularly in 2nd semester. However, I will not be moving the deadline for a number of solid reasons - the due da...

SVG not supported 4:19pm Wed 19th Oct, ANONYMOUS

Hi Chris, could you please help me with this error message when compiling one of my source code files? This is the message "Undefined symbols for architecture x86 64 " main", referenced from implicit entry start for main executable ld symbol(s...

SVG not supported 4:05pm Wed 19th Oct, Christopher M.

Thanks James, I learn something new every day

SVG not supported 4:04pm Wed 19th Oct, Christopher M.

ANONYMOUS wrote (at this stage) it's OK to keep them in there. Though be careful, if the same word exists in fileA and fileB, and you remove info about fileB, then the word should still remain.

SVG not supported 4:02pm Wed 19th Oct, Christopher M.

There's a word for that. Your program does not have to go searching for files. They are either requested with either absolute or relative names. As stated a number of times, and in my email to you this morning, the files "cits" and "cits.txt" are diff...

SVG not supported 3:57pm Wed 19th Oct, Christopher M.

Hi Thomas, That will be fine, as long as the top-level Makefile compiles and links it all. I just (silently) changed the project description, saying that it's required in at least one of your source-code files.

SVG not supported 3:56pm Wed 19th Oct, Zac DA.

ok awesome, thank you so much and what about my first question?

SVG not supported 3:54pm Wed 19th Oct, Christopher M.

ANONYMOUS wrote It's possible to use either read() or fread() . It only depends on how you open, and eventually close, the input. Yes, this is likely the problem. Your understanding is correct, and both read() and fread() will r...

SVG not supported 3:50pm Wed 19th Oct, Christopher M.

The ORIGINAL intention of the project was that the -r option would accept (absolute) pathnames from the command-line, those pathnames would have to exist in the trove-file, and they and all related information would be removed. (and I still prefer tha...

SVG not supported 3:49pm Wed 19th Oct, ANONYMOUS

Good afternoon everyone, how are you doing with your projects? So far I've noticed that a large majority of people in my lab sessions are heavily struggling and I wonder where you all are right now with the project. Personally, me and a few of my clas...

SVG not supported 3:37pm Wed 19th Oct, Thomas M.

Hi Chris, I am just seeking clarification on the structure of the submission for the second project. Firstly, we have the following file tree and we want to make sure that splitting the source and header files into two sub-directories will be okay? ...

SVG not supported 3:34pm Wed 19th Oct, James A.

I'm partial to xxd filename myself; it shows a side-by-side output of both the hexadecimal and ASCII representation of the file's bytes.

SVG not supported 3:33pm Wed 19th Oct, ANONYMOUS

This exact point was answered by Chris here https run help2002?p np opt U670

SVG not supported 3:30pm Wed 19th Oct, James A.

On my distribution of Linux, it seems like I need to define a feature test macro ( POSIX C SOURCE 200809L ) to expose functions like opendir() and readdir() when compiling in -std c11 mode. Try having a look at the manual page for opendir(...

SVG not supported 3:03pm Wed 19th Oct, ANONYMOUS

Thank you for elaborating. Now, I'm just stumped with the method of removing these references. I'm thinking about reading in the trove-file, checking whether the filename(s) are found within the file and overwriting it, but I'm still not sure. Would ...

SVG not supported 3:00pm Wed 19th Oct, ANONYMOUS

Hi I am confused how to implement gzip through pipes. I've watched the example in lecture 18 on October the 3rd, but I am still confused. 1. Is it correct that we should be writing the compressed file straight from our variables? As in, from our trove...

SVG not supported 2:51pm Wed 19th Oct, ANONYMOUS

Is it okay to keep information about the words from deleted files, as long as when our program reads back the trovefile, it knows that there is no relationship between that word and any files?

SVG not supported 2:41pm Wed 19th Oct, ANONYMOUS

Hi, I'm still a bit confused. Is my logic flawed because 1. I shouldn't use fread() on a 'non-text-like' file? 2. It's okay to use fread() to extract the contents of all files as an array of chars, but the problem is when I extract the words from the a...

SVG not supported 2:15pm Wed 19th Oct, Christopher M.

ANONYMOUS wrote For the -r option, every reference to every file provided via the filelist argument(s) should be removed from the trove-file - the absolute pathnames, and any information about the words used in those files. Consider the -u option as ...

SVG not supported 2:13pm Wed 19th Oct, Christopher M.

ANONYMOUS wrote The contents of a JPG file is not a string - it will have many embedded null-bytes, which means you cannot treat the contents as a C string, and not simply print it out. See https run help2002?p np opt U676

SVG not supported 2:09pm Wed 19th Oct, Zac DA.

If the current directory is " uni CITS2002" and the file name in the filelist in the command-line terminal is "cits.txt"(. trove -b cits) which is located at " uni cits.txt"(outside the current directory), will this give an error? but if the command ...

SVG not supported 1:59pm Wed 19th Oct, ANONYMOUS

I am also confused about how to implement Gzip. From what I understand, gzip has the optional argument of a filename, but this is not what we should be doing right? (as in, we shouldn't be writing a file to disk and then calling gzip to make a compr...

SVG not supported 1:50pm Wed 19th Oct, ANONYMOUS

Hi, regarding project 2's command line options would '-r' involve reading in the trovefile, checking whether the filename (from the filelist) is found within the trovefile and remove that particular line? With '-u', would we open a new trovefile, co...

SVG not supported 12:26pm Wed 19th Oct, ANONYMOUS

Hi Chris I have a read string from file functions which is not working for jpg files like . trove-sample-data dilbert-requirements.jpg. Instead of outputting the full string, it outputs something weird (see attached). I'm not sure if I can post my func...

SVG not supported 11:03am Wed 19th Oct, ANONYMOUS

Agree, I will try to reinstall it. Thank you, professor.

SVG not supported 4:03am Wed 19th Oct, Christopher M.

ANONYMOUS wrote Something sounds quite wrong, perhaps with your installation of packages. If direct.h was not being found by the compiler with the project's required options, then many other students would have mentioned it by now.

SVG not supported 3:44am Wed 19th Oct, Christopher M.

It's possible (if the buffer is shorter than the whole file), but it can easily be detected and handled with the next read from the file.

SVG not supported 3:42am Wed 19th Oct, Christopher M.

ANONYMOUS wrote Executing "echo ?" must be being performed at the shell level whereas, I presume the error is being reported after your trove process, C code, is executing gzip. Thus, executing "echo ?" will report the exit status of your trove proc...

SVG not supported 3:30am Wed 19th Oct, Christopher M.

ANONYMOUS wrote (at this stage, and as not defined) it doesn't really matter. The sample solution does include it. Of course, it will never be listed as matching and searched word.

SVG not supported 11:55pm Tue 18th Oct, Leo G.

Isn't there a risk of the buffer stopping in the middle of a word?

SVG not supported 10:31pm Tue 18th Oct, ANONYMOUS

Hello, I'm also having a similar problem with the op, but instead my trove program, when attempting to build the trove-file, prints this statement out gzip myTroveFileName file size changed while zipping Now, when I do "echo ?" straight afterward...

SVG not supported 9:05pm Tue 18th Oct, ANONYMOUS

Hi, If a file contained 0 words in it should that file still be included in our trovefile or just disregarded

SVG not supported 6:34pm Tue 18th Oct, Christopher M.

ANONYMOUS wrote This really has been discussed many, many times in this forum, already. - text-files do not need to have a suffix of ".txt" - filenames ending in ".txt" are not necessarily text-files. - filenames may not have a ' ' character (or the nul...

SVG not supported 5:13pm Tue 18th Oct, ANONYMOUS

It didn't work with -std c99 too

SVG not supported 4:59pm Tue 18th Oct, ANONYMOUS

Hi, in regards to this "The default name of the trove-file must be tmp trove" if I was making the trovefile a txt file, would it be named trove.txt? Because I cannot add ' ' to the name of a text file. If so, what do I do about the " tmp " part...

SVG not supported 1:56pm Tue 18th Oct, Christopher M.

ANONYMOUS wrote Unusual At least try it with -std c99

SVG not supported 1:49pm Tue 18th Oct, ANONYMOUS

Thank you Professor

SVG not supported 1:48pm Tue 18th Oct, ANONYMOUS

Yes, I have the correct version intalled. the copy of the dirent.h is not included in the source folder now. It works if I remove the -std c11 but not working if I included it, it shows error DT DIR undeclared

SVG not supported 1:07pm Tue 18th Oct, Christopher M.

I suspect we could wait 24 hours, and no other 'guys' would reply. On the project sheet, the command at prompt.1 searches an existing trove-file while the command at prompt.2 builds one. You certainly can't search a non-existent file.

SVG not supported 1:03pm Tue 18th Oct, Leo G.

Hey guys, Just for clarification the instructions tell us that the first invocation of trove relies on an existing trove-file, and that it is only the second one that build a trove-file. What is that supposed to mean? Do we need to throw an er...

SVG not supported 12:50pm Tue 18th Oct, Christopher M.

ANONYMOUS wrote Perhaps review the steps here https units CITS2002 labsheets software.php

SVG not supported 12:18pm Tue 18th Oct, Christopher M.

From the project description - "A trove-file will contain the absolute pathnames of the files..." A trove-file does not record directory names, just filenames, so it makes no sense to try to remove a directory name.

SVG not supported 12:17pm Tue 18th Oct, Christopher M.

ANONYMOUS wrote The (compressed) trove-file, on disk, should remain until deleted (manually, with the 'rm' command). A very common requirement would be to perform multiple searches, in a row, using the same trove-file.

SVG not supported 12:06pm Tue 18th Oct, Lloyd N.

Hey really sorry but I'm still a bit concerned with question 2 from my original post. Q1 and Q3 are sorted, I just had to use the sample solution properly. But now my program does what the sample solution does and just throws an error if trying to re...

SVG not supported 11:59am Tue 18th Oct, Christopher M.

ANONYMOUS wrote (in your last post you were using Linux...?) Yes, all files; no need to look for, or exclude, certain files.

SVG not supported 11:58am Tue 18th Oct, Christopher M.

ANONYMOUS wrote You should not need to, and should not, require your own local copy of dirent.h I do not know which one it is, but installing a standard package should install the correct version of dirent.h, for your system, in the correct location.

SVG not supported 11:49am Tue 18th Oct, ANONYMOUS

One more question, do we have to read hidden file like .DS Store. Thanks

SVG not supported 11:45am Tue 18th Oct, ANONYMOUS

Greetings, I am trying to use the dirent.h , I downloaded it and put it in the same directory as my source code, I added it in both the header files, Makefile and declared. But somehow It shows DT DIR undeclared every time I make . But then ...

SVG not supported 8:33am Tue 18th Oct, ANONYMOUS

Hello, I'm wondering if the named trove file would be "called" again in further tests after being compressed. Because I've implemented the gzip and zcat functions in the project but upon testing after compressing the file, the program does not execut...

SVG not supported 4:46am Tue 18th Oct, Christopher M.

zcat does not require any specific filename or extension if it reads from its standard input, rather than from a named file. Setting this up is just that same as you must have done for compressing with gzip - opening a file and then using dup2() ...

SVG not supported 4:38am Tue 18th Oct, Christopher M.

ANONYMOUS wrote The lecture shows that you can easily read and write the contents of any memory (such as memory holding data-structures). You do not need to format that data to a human-readable form using, for example, printf() . However, as disc...

SVG not supported 2:35am Tue 18th Oct, Lucas T.

My implementation doesn't store the uncompressed file onto the filesystem, it streams input into gzip and streams the output into the trove file. The problem arises that once the compressed file is stored on the filesystem, zcat expects the '.Z' wher...

SVG not supported 10:03pm Mon 17th Oct, ANONYMOUS

Hello Chris, Currently we are looking at your code from the lecture about File I O. There is an example about integer arrays being written to and read from a binary file. I was wondering would the same methodology would work for other structures say ...

SVG not supported 4:03pm Mon 17th Oct, Christopher M.

You can use the C processor to only conditionally define things once if defined( TROVE H ) define TROVE H .... .... endif TROVE H

SVG not supported 3:35pm Mon 17th Oct, Haoxuan L.

VScode has been fine but out of no where today I am getting error saying " include file includes itself" I have a treve.h file that has include "hashtable.h" and inside my hashtable.h I have include "trove.h" I played around and deleted some stuff one...

 UWA week 41 (2nd semester, week 11) ↓
SVG not supported 8:28pm Sun 16th Oct, ANONYMOUS

in my trove.c file, I use getopt. When I use my makefile sorry, Chris has hidden the (assessable) contents of the Makefile and run 'make' at the command line, it decides that getopt is implicitly defined. I've tried putting ' include unistd.h ' in ...

SVG not supported 5:19pm Sun 16th Oct, ANONYMOUS

Missed this part in my confusion. Thank you

SVG not supported 5:11pm Sun 16th Oct, Matthew M.

Thanks for replying on a Sunday and congrats on the teaching award, very well deserved I will use tmp trove-file as instructed in the outline. Cheers, Matt

SVG not supported 4:45pm Sun 16th Oct, Christopher M.

Project description says - "... if indexed words must be at least 3 characters long." If. and - "If the -l option is not provided, the default length is 4."

SVG not supported 4:42pm Sun 16th Oct, ANONYMOUS

Hi, I'm looking for some clarification on the length of words. From the project description, the word length is "at least 3 characters long" so I would assume greater than equal to 3. However, when I tried using the sample solution for the PNG file, o...

SVG not supported 4:05pm Sun 16th Oct, Christopher M.

I use the command-line utility od -c .... or od -a ... for a quick look.

SVG not supported 4:03pm Sun 16th Oct, ANONYMOUS

Oops. Wrong file attached.

SVG not supported 4:02pm Sun 16th Oct, ANONYMOUS

Thank you I realised the reason just now as well after trying to copy and paste it into a text editor as seen in the image below. Much appreicated

SVG not supported 3:53pm Sun 16th Oct, Christopher M.

ANONYMOUS wrote There's a non-alphanumeric character between the 4 and M 0001120 017 347 034 016 u 320 334 271 353 033 316 267 277 375 376 0001140 k 255 275 326 373 003 370 ? 257 301 300 k 4 0001160 032 M 035 035...

SVG not supported 3:48pm Sun 16th Oct, ANONYMOUS

Hi Chris, When running trove on the csseduck.png image, the first two lines in the sample solution are shown as "filename1 - home trove-sample data csseduck.png word1 - 2TXX" When I look for 2TXX in the binary file however, I find the text shown in the...

SVG not supported 3:38pm Sun 16th Oct, Christopher M.

Quick answer... What does the project sheet say?

SVG not supported 3:00pm Sun 16th Oct, Matthew M.

Quick question... Do we store the trove-file in the working directory ". tmp trove-file" or the root directory " tmp trove-file"? Cheers

SVG not supported 5:25am Sun 16th Oct, Christopher M.

ANONYMOUS wrote The names of files - filenames - cannot contain the ' ' character or the 0 character. The ' ' character separates the components of a pathname, such as "dir1 dir2 dir3 file1". As a special case, the pathname " " refers to the root-dir...

SVG not supported 5:18am Sun 16th Oct, Christopher M.

ANONYMOUS wrote Hello; glad that the sample solution is helping. If the value of BUFSIZ is, say, 1000 bytes, then a successful fread() will copy 1000 bytes into your buffer (and will not add a null-byte). And any of those 1000 bytes may be nul...

SVG not supported 2:41am Sun 16th Oct, Lloyd N.

Hello, I just have a few questions regarding the update and remove options for our trove program. 1) If the update option was chosen along side a length argument, would the new word length apply to just the new file(s) passed through? Or would it apply...

SVG not supported 7:08pm Sat 15th Oct, ANONYMOUS

How can you name a file with " "? When I go to name a file on my desktop to be include a " " it says "file names cannot contain " "". Is the tmp trove refering to creating a temporary file?

SVG not supported 5:38pm Sat 15th Oct, ANONYMOUS

Hello Chris, Thank you for the updated sample solution, it helped us realise that our program wasn't correctly reading the input files. We have been attempting now to read the files using fread() using code similar to this, that we found in the lectur...

SVG not supported 8:21pm Fri 14th Oct, Christopher M.

Of course, if you knew ahead of time what the longest line s length was

SVG not supported 8:15pm Fri 14th Oct, ANONYMOUS

If using a large buffer is appropriate then I will just do that since it is simpler to implement. I was mainly trying to account for the edge case where the trove file is massive, which would cause my code to break

SVG not supported 7:45pm Fri 14th Oct, Christopher M.

The approach seems to be overkill, because a large fixed size array will be sufficient in all practical situations, but you can check for the end of file condition with feof() .

SVG not supported 7:43pm Fri 14th Oct, ANONYMOUS

I read through the documentation and now am running execl(" usr bin gzip","gzip", NULL) and then using dup2 on the output file stdout but now I am getting a different error and Im not sure if its because I'm executing gzip wrong or for another reason...

SVG not supported 6:41pm Fri 14th Oct, ANONYMOUS

I'm trying to use getline() to read from my trove file, since it consists of many discrete lines but depending on how many files worth of data it includes, the lines could become very long. However, I noticed that getline() returns -1 both on reachin...

SVG not supported 3:19pm Fri 14th Oct, ANONYMOUS

Beautifully, thanks D

SVG not supported 2:27pm Fri 14th Oct, Christopher M.

ANONYMOUS wrote If gzip is given any filenames, it attempts to compress those files, so those files must exist. Read the introductory Description of man gzip again.

SVG not supported 2:03pm Fri 14th Oct, Christopher M.

ANONYMOUS wrote It has been stated and discussed many times in this forum, that the files you are indexing might not be text-files and, thus, do not contain well-formed lines, and cannot be read line-by-line (with fgets). This should be of some help ...

SVG not supported 1:52pm Fri 14th Oct, Christopher M.

ANONYMOUS wrote I am unsure why this has become so convoluted. By its very definition, an absolute pathname, whether it refers to a directory or a file, whether that named directory name or that named file exists, simply begins with a ' '.

SVG not supported 1:43pm Fri 14th Oct, ANONYMOUS

Hi, I've currently got pipe() and dup2() setup to let me use stdout from my main program as stdin for a child process where I intend to use gzip to write my trovefile but I'm running into issues with using that as the input for gzip and then creating...

SVG not supported 12:04pm Fri 14th Oct, ANONYMOUS

Hi, I'm having trouble indexing all the words in a file, line-per-line if the length of each line is unknown. People have suggested realloc() and malloc() but you would need to know the length of a line to use them, so I'm hitting a wall at this stag...

SVG not supported 10:43am Fri 14th Oct, ANONYMOUS

Hi Chris, Can I please clarify the below? Absolute file directories - will this be a fully complete absolute pathname? i.e. "CITS2002" as in the example above would be expected to fail (as it does not exist relative to the working directory), but " path...

SVG not supported 9:18am Fri 14th Oct, Christopher M.

ANONYMOUS wrote Via the command-line you may be asked to index files from anywhere. They could be 'local', absolute, or relative to where you are.

SVG not supported 9:16am Fri 14th Oct, ANONYMOUS

Hey Chris, Thanks, the return result from realpath is NULL which is correct. I think I confused myself as I've been trying to find absolute pathnames for files directories located above the current working directory (i.e looking for "CITS2002" from wit...

SVG not supported 8:18am Fri 14th Oct, Christopher M.

ANONYMOUS wrote It means you've set a variable (it's on the left-hand-side of an assignment statement), but have never used it (it's never on the right-hand-side of an assignment statement, or passed to a function).

SVG not supported 8:09am Fri 14th Oct, ANONYMOUS

Does anyone know what this error means when trying to compile using 'cc -std c11 -Wall -Werror -o trove trove.c'. I declared below that statement with fopen().

SVG not supported 6:22am Fri 14th Oct, Christopher M.

ANONYMOUS wrote Has the modified sample solution helped you find the problem?

SVG not supported 5:23am Fri 14th Oct, Christopher M.

If the file no longer exists in the absolute location stated in the trove-file. No need to try and find it elsewhere.

SVG not supported 5:22am Fri 14th Oct, Christopher M.

ANONYMOUS wrote Interesting, general question. There's no golden rule for all situations, and your decisions are likely driven by personal preferences, or whatever your boss demands of the software you write for her so that she can make her next yacht...

SVG not supported 4:39am Fri 14th Oct, Gihad C.

I am now unsure of how to interpret "if a file does not exist"... Does this mean that before printing a file's pathname (as it appears in the trove-file), our program should be scanning all available directories in the system to see if the file has be...

SVG not supported 3:31am Fri 14th Oct, Christopher M.

ANONYMOUS wrote I can replicate this on both macOS and Linux. Suggest that you check the return result from realpath() define DEFAULT SOURCE include stdio.h include stdlib.h include errno.h int main(int argc, char argv ) char ab...

SVG not supported 3:06am Fri 14th Oct, Christopher M.

This has been discussed a number of times on this forum already. Search for strdup

SVG not supported 3:05am Fri 14th Oct, Christopher M.

ANONYMOUS wrote It's very hard to imagine what's happening here. Firstly, our words cannot have semicolons in them, as a semicolon is not an alphanumeric character. Secondly, it's unlikely that your code is reporting that error message - it can only be...

SVG not supported 2:59am Fri 14th Oct, Christopher M.

The project does not have to do anything beyond list existing files. It does not have to check for more recently modified files (and then index them again to ensure that the required search term is (still) present??)

SVG not supported 2:56am Fri 14th Oct, Christopher M.

ANONYMOUS wrote Unsure what you mean by 'do all command line options'. The strongly encouraged approach is to parse command-line options by calling getopt() , verify their meaning combinations in your main() function, and then call functio...

SVG not supported 1:43am Fri 14th Oct, ANONYMOUS

what if you just declared it explicitly at the top of your code (or somewhere before it is called)? something like extern char strdup(char );

SVG not supported 12:04am Fri 14th Oct, Martin E.

Hello I am trying to use strdup() for allocation of char pointers within one of my structures, but when compiling gcc complains that strdup() is an implicit function not actually declared? It is within the header file of string.h, but gcc seems to i...

SVG not supported 10:49pm Thu 13th Oct, ANONYMOUS

Hi, I'm trying to split the 'words' within each file, but if one of the words has a semicolon within it, the terminal will return 'command not found'. Have I been trying to split the words incorrectly or is this normal? Thanks

SVG not supported 9:04pm Thu 13th Oct, ANONYMOUS

Hi Chris, I'm having some trouble successfully utilising realpath. I am using it as seen below char absolutePath 1024 ; realpath( directory file arg here (i.e. 'CITS2002') , absolutePath); However if the directory file that was provi...

SVG not supported 8:34pm Thu 13th Oct, Gihad C.

The brief mentions that if a file has been deleted since the trovefile was built, it should not make up any part of the results of the search function of the trove program. What about if files have been edited (and potentially new words been added) s...

SVG not supported 3:37pm Thu 13th Oct, ANONYMOUS

Will it be okay for us to do all command line options in one file or should we separate them?

SVG not supported 2:09pm Thu 13th Oct, ANONYMOUS

My project partner and I have come up with about 3 different plans of attack for a certain portion of the project and are unsure about how to proceed. The decision mainly involves a tradeoff between memory efficiency (i.e. reducing the amount of ...

SVG not supported 1:19pm Thu 13th Oct, Christopher M.

"usr bin zcat" should be " usr bin zcat"

SVG not supported 12:13pm Thu 13th Oct, ANONYMOUS

I managed to figure out gzip and complete the code to compress a file. Now I am trying to decompress a file using zcat, however when I call, "execl("usr bin zcat", "zcat", trovefile, NULL);" I get a, "no such file or directory" error. Do you know what ...

SVG not supported 9:41am Thu 13th Oct, Christopher M.

ANONYMOUS wrote You cannot use strings like "gzip output.txt" in calls to execl() That's syntax recognized by the shell, but not recognized by the gzip program (or any others). You'll need to understand how the pipe() and dup2() ...

SVG not supported 9:29am Thu 13th Oct, ANONYMOUS

I am trying to use gzip to compress the stdin. When I call, " gzip output.txt" in the command line, everything works fine, but when I use the line, "execl(" usr bin gzip", "gzip output.txt", NULL);" in C, and then run my code, I get the error messa...

SVG not supported 6:53pm Wed 12th Oct, Christopher M.

ANONYMOUS wrote You must have missed it in many lectures, in the introductory labsheets, and in the comments of labsheet and workshop sample solutions. The command-line options are requesting that the compiler check your program for conformance agains...

SVG not supported 6:49pm Wed 12th Oct, Christopher M.

ANONYMOUS wrote I feel that you're overthinking the efficiency aspect, and ignoring some important issues. You're probably using a computer with 8 BILLION bytes of RAM, able to make 2 BILLION instructions comparisons per second. So when you say 'take a...

SVG not supported 4:31pm Wed 12th Oct, ANONYMOUS

Sorry if this is a dumb question but what does the following point mean? "2. Your submission will be compiled with the C11 compiler arguments -std c11 -Wall -Werror, and marks will not be awarded if your submission does not compile." Mainly the part wi...

SVG not supported 10:48am Wed 12th Oct, ANONYMOUS

Hello I am trying to write a function that will extract the 'words' in a file and have come across some considerations. We don't know how long the words could potentially be when we first start traversing the file, so I'm wondering the most efficient ...

SVG not supported 9:17am Wed 12th Oct, Christopher M.

ANONYMOUS wrote I can only imagine that you're not correctly finding copying storing the sequences of alphanumeric characters. I have modified the sample solution to add (just) those 3 non text-files to the drop-down filelist menu, and a link to list...

SVG not supported 2:18am Wed 12th Oct, ANONYMOUS

Hello, Our code at the moment is reading pretty much all the sample data files accurately as in the number of words in each file match the sample solution's. However, the png, jpg and rotate exec file word count is significantly smaller than the samp...

SVG not supported 7:49pm Tue 11th Oct, Christopher M.

ANONYMOUS wrote Your project will need to support the -f option. The sample solution cannot support it, as multiple people using the same server cannot all use the same default trove-fill name, or be permitted to write to an arbitrary location on the ...

SVG not supported 7:15pm Tue 11th Oct, ANONYMOUS

hello, for our project, can we follow exactly as the sample solution? so when you test run our code, is it going to be tested the same way as the sample solution? Including the -f trovefile option being silently ignored?

SVG not supported 6:49pm Tue 11th Oct, Christopher M.

Yes. And you can confirm this with man isalnum

SVG not supported 6:47pm Tue 11th Oct, Christopher M.

ANONYMOUS wrote Great news

SVG not supported 6:05pm Tue 11th Oct, Martin E.

Just as a clarification, alphanumeric characters are ONLY characters between a-z, A-Z and 0-9?

SVG not supported 5:32pm Tue 11th Oct, ANONYMOUS

Hello, We just retried our approach, using realloc() instead of malloc() to grow our vectors and used the code from the labsheet 4 concordance example and it's working now. Thank you

SVG not supported 3:45pm Tue 11th Oct, Christopher M.

Hello Martin. There is nothing special about indexing non text-files, compared to text-files. Our simple definition of text-files, all semester, has been the same - line oriented data (using n or r n to terminate each line) and the data being easy ...

SVG not supported 12:27pm Tue 11th Oct, Martin E.

I was wondering what it is meant by indexing non-text files. For example, if we were to index a png file, would the data we would be processing by using fopen() be equivalent to using cat within the terminal? How are words supposed to be indexed if t...

SVG not supported 4:30am Tue 11th Oct, Christopher M.

(Always) very difficult to diagnose from the description alone, but some commonly seen reasons are - are you using realloc() , not malloc() , to grow your vectors? - are you incrementing that integer counter after each addition to the vector...

SVG not supported 7:18pm Mon 10th Oct, ANONYMOUS

Hello, We are currently trying to create a function that adds a value to dynamically allocated array of strings using malloc() and a buffer, each time it's called. For the size of the array, we have a global counter variable that is being updated thro...

SVG not supported 6:38pm Mon 10th Oct, Christopher M.

fread() - sorry, typo.

SVG not supported 6:35pm Mon 10th Oct, ANONYMOUS

Sorry, for fopen() do we use read() or fread()?

SVG not supported 6:27pm Mon 10th Oct, Christopher M.

ANONYMOUS wrote Providing you use them together, you may use - open, read, write, close or - fopen, fread, fwrite, fclose It makes little sense to use fgets() on non-text, non-line-oriented files, as it will stop reading each time it finds a newlin...

SVG not supported 5:23pm Mon 10th Oct, ANONYMOUS

This might not be the answer that you're after, but from Lecture-8 there's this paragraph "File access mode flag "b" can optionally be specified to open a file inbinary mode (described later). This flag has effect only on Windows systems, and is ignor...

SVG not supported 2:42pm Mon 10th Oct, ANONYMOUS

When reading binary files from the disk (e.g. compiled executables, jpegs) should we use open() or fopen()? If we use fopen() should we use fread() or fgets() as all of these methods produce different results when opening a binary file and printing th...

SVG not supported 12:15pm Mon 10th Oct, Christopher M.

ANONYMOUS wrote Yes, you write absolute pathnames into the trove-file. In yellow highlighted text, the project sheet says "there is no required format for the trove-file". You choose.

SVG not supported 12:03pm Mon 10th Oct, ANONYMOUS

Hi Chris, Regarding what you said about the trove-file do we 'input' the real pathnames of the relevant files into a trove-file and return the contents of this trove-file? The project description says "the filenames stored in the trove-file should b...

SVG not supported 10:00am Mon 10th Oct, Christopher M.

What does the sample solution do?

SVG not supported 9:43am Mon 10th Oct, ANONYMOUS

Hi, What is the desired output of the program if a directory file that doesn't exist is included in the filelist? Is it ignored and all other files do what they need to or does it fully stop the program? Tia

SVG not supported 3:34am Mon 10th Oct, Christopher M.

It is not a project requirement that trove supports wildcard matching of its command-line arguments. Values such as ' ' are expanded by the shell, before it calls trove. The sample solution does not support expansion because it does not invoke trove us...

 UWA week 40 (2nd semester, week 10) ↓
SVG not supported 11:36pm Sun 9th Oct, Kuan Y.

Hi,These functions that shows in the project description are not enough to support wild matching(. trove -b ), can we use 'find' command?

SVG not supported 5:19pm Sun 9th Oct, Christopher M.

ANONYMOUS wrote With exactly one of -b, -r, or -u you are building or modifying a trove-file. With none of those options you are searching an (existing) trove-file.

SVG not supported 4:50pm Sun 9th Oct, ANONYMOUS

Could someone please clarify this. If we include no options when invoking trove, and only one additional command line argument is provided (a single word or single filename), should we assume that we want to invoke prompt.1 or prompt.2? Or is there p...

SVG not supported 6:54am Sun 9th Oct, Christopher M.

You should be able to index any type of file, text-files or 'binary' files. You'll notice that the sample solution indexes an executable file and a JPG image file.

SVG not supported 6:52am Sun 9th Oct, Christopher M.

Hello Simon, There's no always-correct answer, because it'll depend on the actual file being read and (one day) your choice will always be too small. I typically just use BUFSIZ, for convenience, with gives 8KB on Linux, but only 1KB on macOS. But both ...

SVG not supported 4:39pm Sat 8th Oct, ANONYMOUS

I should add, I'm aware of checking file types regardless of windows extension conventions, like ".txt", is this saying I should skip those that aren't simple text files, and is hinting I should write logic to do so?

SVG not supported 4:35pm Sat 8th Oct, ANONYMOUS

I see that the Project 2 spec says "Note that the files do not have to be text-files - they could equally be, for example, executable programs or object files.", Is this intended as you would index the strings inside of a executable or that the files...

SVG not supported 4:14pm Sat 8th Oct, Simon E.

When reading a line from a file with fgets, we need to provide a statically allocated character array for the function to place its output into (fgets's first argument). How long should this array be? I currently have a buffer with a length of 8192, ...

SVG not supported 3:41am Sat 8th Oct, Christopher M.

Hello Lucas, This problem arises because compression programs are typically used to compress files that are already on disk, and 'replace' them with a compressed version, using an additional suffix to identify what was used to compress them. Review the...

SVG not supported 3:36am Sat 8th Oct, Lucas T.

Hello Professor. On macOS it seems the zcat utility expects all files to end with the ".Z" extension with no arguments to remove this restriction, whereas gzcat is functionally identical but does not have this restriction. Can I use gzcat instead to ...

SVG not supported 3:15am Sat 8th Oct, Christopher M.

Thanks; yes, recursively traverse all named directories to locate all files to be indexed. Try this on the sample solution.

SVG not supported 1:30am Sat 8th Oct, ANONYMOUS

Hi Leo, The subdirectories within the named directory have to be traversed as well. Found this on the project page. "prompt.2 . trove -f trovefile -b -r -u -l length filelist ... A filelist is a sequence of one-or-more filenames or ...

SVG not supported 9:34pm Fri 7th Oct, Leo G.

Hi guys, If given a directory in filelist , should we retrieve only the files in this directory, or traverse every subdirectory too? Cheers.

SVG not supported 9:38am Thu 6th Oct, Christopher M.

realpath() does not do this; it must be something else in your code.

SVG not supported 9:37am Thu 6th Oct, Cohen R.

Thank you I figured it out but now I have another problem. It wasn't spaces but realpath is adding v at the end instead of the path v mnt c Users ... Project2 test mnt c Users ... Project2 v and this is causing it not to work. Do you have any idea ...

SVG not supported 9:18am Thu 6th Oct, Christopher M.

There is nothing wrong with having spaces in a file or directory name; it must be your code that is trying to find break file or directory names into words or tokens. If you place double quotes around multiple words on the command-line program ...

SVG not supported 9:10am Thu 6th Oct, Cohen R.

Hi, I was doing the project and I kept getting errors about opening directories and I soon found out that it was because my directory names have spaces in them. Is there a way to solve this? I tried just adding quoted in the command line but when I t...

SVG not supported 3:24am Thu 6th Oct, Christopher M.

Yes, anything within square brackets ... is optional, and any use of the square brackets may occur in any order. It's exactly the same notation as you've seen in nearly every online manual for a command (in section 1 of the manual) - man cal ...

SVG not supported 3:20am Thu 6th Oct, Christopher M.

ANONYMOUS wrote The ' ' is a shell-wildcard. Before invoking the trove program, the shell expands the ' ' to all files and directory names in the current directory, and then passes them to the trove program as command-line arguments. Thus, the filel...

SVG not supported 10:39pm Wed 5th Oct, Lloyd N.

Actually never mind, I was thinking about this the wrong way.

SVG not supported 10:35pm Wed 5th Oct, Lloyd N.

Hi Chris, If we end up choosing none of the 3 options (b,r and u) how would our program know if we are trying to invoke prompt.1 (. trove -f trovefile word) or prompt.2 (. trove -f trovefile -b -r -u -l length filelist)? Since i...

SVG not supported 8:57pm Wed 5th Oct, ANONYMOUS

hello, can I ask what does the mean in the video when you did . trove -b ? does it mean select all contents from the file list? sorry if I misunderstood but I don't think the file list was mentioned in the video though? thanks in advance

SVG not supported 7:23pm Wed 5th Oct, Christopher M.

ANONYMOUS wrote Files ending in .txt DO NOT have to be text-files, and text-files DO NOT have to end in .txt C source-code files are text-files, and they do not end in .txt Reading? Review Lecture-8. tmp trove is (will be) a file , not a direc...

SVG not supported 7:19pm Wed 5th Oct, ANONYMOUS

Hello, the project sheet mentions that "Note that the files do not have to be text-files - they could equally be, for example, executable programs or object files." How do you read non .txt files? I've tried to read a .docx file but all i got from it...

SVG not supported 7:15pm Wed 5th Oct, Christopher M.

ANONYMOUS wrote I can't see any use of malloc() in your code. strArray is NULL, so you cannot access strArray 0 . Even if strArray were not-NULL, strArray 0 does not point to sufficient (not even any) space to hold the string. Have a look at the ...

SVG not supported 6:53pm Wed 5th Oct, Christopher M.

ANONYMOUS wrote Just to 'clean up' from any previous commands, and to show that . trove -b ... creates a new trove-file.

SVG not supported 6:50pm Wed 5th Oct, ANONYMOUS

Hi, I am a bit confused about why the tmp trove was removed right after the compiling step before any invocations of the prompts occured?

SVG not supported 5:36pm Wed 5th Oct, ANONYMOUS

char strArray NULL; strcpy(strArray 0 , "adasd"); This code will cause a segmentation fault, how can I solve it? I used the malloc function but it still doesn't work.

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

ANONYMOUS wrote 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 contents...

SVG not supported 4:02pm Wed 5th Oct, Christopher M.

ANONYMOUS wrote Not quite true. (On Linux) the manual also states that you need to define certain pre-processor standard constants to 'get' the required standard. See the example in https run help2002?p np opt B519

SVG not supported 3:59pm Wed 5th Oct, Christopher M.

It's possible (easy) to store the value of a pointer in a file - printf(" p n", (void )my pointer ); BUT, you should re-think your approach. The value of a pointer is meaningful in a process that allocated created it but, if written to a file, ...

SVG not supported 1:19pm Wed 5th Oct, ANONYMOUS

Also, when it says 'The contents of each named file should be indexed' and 'open each file found', what does this mean? Does it mean that if the file is a text file, then our program should open it and read all the words in the file and that's how i...

SVG not supported 1:09pm Wed 5th Oct, ANONYMOUS

Hi Chris, I'm trying to wrap my head around the project. I watched the sample solution video, but I think I become more confused. Could you please let me know whether my understanding of the project is correct? The first command invocation is . trove...

SVG not supported 1:03pm Wed 5th Oct, ANONYMOUS

Hello, We are currently trying to use realpath() to get the absolute pathnames of filenames in a filelist, however we keep getting an implicit declaration warning when calling this function. The header files we have currently included are limits.h stdio...

SVG not supported 12:35pm Wed 5th Oct, Zhuo H.

for the last sentence, I mean should I change all the pointers into arrays so they can be stored in a text file? I know how to r w to a text file, but not very familiar with working with a binary file in this situation.

SVG not supported 12:30pm Wed 5th Oct, Zhuo H.

Hi Professor, I am trying to store my data in the trove file, Which is a combination of some struct looks similar to this (Not the same in my work, just for demo) typedef HASH FILE filelist; typedef struct filelist char string; ...

SVG not supported 11:53am Wed 5th Oct, Christopher M.

ANONYMOUS wrote If no trove-file is given on the command-line, you use the default trove-file name. Watch the sample video.

SVG not supported 11:51am Wed 5th Oct, ANONYMOUS

Right okay, and if no trove-file is provided do we look for a file matching the default name and if that doesn't exist search everything?

SVG not supported 11:48am Wed 5th Oct, Christopher M.

It searches for the requested word, reading from the previously built trove-file.

SVG not supported 11:46am Wed 5th Oct, ANONYMOUS

Hi, for the first format - . trove -f trovefile word Is that asking trove to find the absolute pathname of every file in every directory containing the provided word? What role does the optional trove-file input play in this scenario? If it is pr...

SVG not supported 11:36am Wed 5th Oct, ANONYMOUS

awesome thanks

SVG not supported 11:32am Wed 5th Oct, Christopher M.

ANONYMOUS wrote Not a silly question. Exactly zero or one of them may be provided - that's what the (cryptic) notation " -b -r -u " means.

SVG not supported 11:26am Wed 5th Oct, ANONYMOUS

Hi there, can all 3 options '-b' '-r' '-u' be toggled at once or are they singluar like only one can be called at once? So is it -b OR -r OR -u, or can you accept multiple? At the moment I thought of it as being seperate options and not being able t...

SVG not supported 9:07am Wed 5th Oct, Christopher M.

We don't yet have a web-based version of the sample solution, but hopefully this video will provide greater understanding http units CITS2002 projects trove-sample.mp4 (47MB, 150secs) It shows the sample solution being c...

SVG not supported 3:34am Wed 5th Oct, Christopher M.

ANONYMOUS wrote (Any) trove-file is a file . The default trove-file is named " tmp trove". Any other name, such as " tmp trove.txt" is not the same name, and not the correct file. define DEFAULT SOURCE include stdio.h include stdlib.h int mai...

SVG not supported 3:24am Wed 5th Oct, Christopher M.

ANONYMOUS wrote I'm not going, or able, to provide a description of the trove-file format, because its design (and implementation) is completely up to you. There is no single required format, else it would have been specified on the project sheet. You...

SVG not supported 3:00am Wed 5th Oct, Christopher M.

If your computer doesn't have a trove-file already, then the first command to build or update will need to create one (because it needs to place it's 'work' somewhere ). What does CML stand for?

SVG not supported 8:22pm Tue 4th Oct, ANONYMOUS

Hi Chris, Just a bunch of questions i would like to ask... 1) trovefile default is tmp trove - is trove a folder or the actual file? if its the latter means if i were to make the default tmp trove.txt (for example since there is no restriction on t...

SVG not supported 8:04pm Tue 4th Oct, ANONYMOUS

Hello Chris, I'm quite confused with how the trove file should more or less look like. How does each file listed in the trove file store the words to be searched? - does each of the listed files store those words like a hashtable? - e.g. file1 - "hel...

SVG not supported 5:45pm Tue 4th Oct, Xiaojun H.

So initially the trovefile doesn't exist unless I create it using the 2nd prompt in the CML?

SVG not supported 4:29pm Tue 4th Oct, Christopher M.

I've never seen the acronym CML before; guessing CoMmand Line?? Where did you see CML? ANONYMOUS wrote Could be (full) absolute pathnames, or relative pathnames. It does not matter. No, you can 'convert' them all to absolute pathnames with the realpat...

SVG not supported 3:18pm Tue 4th Oct, ANONYMOUS

Hi, In the answer to another question a couple of days ago, I saw the filelist on the CML is just a list of names such as file1 file2 dir1 file3 dir2. Would these names be represented as full pathnames? If not do we somehow have to iterate through all d...

SVG not supported 3:53am Tue 4th Oct, Christopher M.

ANONYMOUS wrote Initially the trove file does not exist. You will need to create it before you can write to it, usually by open()ing it with the correct option to create it. The filename to be created is named tmp trove, unless you provide another f...

SVG not supported 3:43am Tue 4th Oct, Christopher M.

ANONYMOUS wrote We're unable to solve this because all you've provided is "... keeps giving me errors".

SVG not supported 8:22pm Mon 3rd Oct, ANONYMOUS

Hello I was attempting to make a plan of how to go about creating the program and have a few questions... I am assuming that the indexfile does not exist and we have to create it so does that mean that the program is meant to create a file(?) and pl...

SVG not supported 7:06pm Mon 3rd Oct, ANONYMOUS

I am just confused as to using the open() read() system calls, I am on a windows machine and using these system calls keeps giving me errors. Would is be okay of I still use fopen() etc as it still uses the open() system call if not what will be the ...

SVG not supported 6:06pm Mon 3rd Oct, Christopher M.

That's quite a list of questions (but you're not interrupting anything by asking). - it's quite feasible for all files in an index-file to have been deleted since the index-file was created. - you only update the index-file if the -u option is provided...

SVG not supported 3:57pm Mon 3rd Oct, Zhuo H.

Sorry to interrupt. I have some minor questions about the second project. First, can we assume that all files haven't been modified deleted since the last time we created index files for them, or should we update the index file every time we run the ...

SVG not supported 2:27pm Mon 3rd Oct, ANONYMOUS

Hi, Will we be provided with a sample solution for this project?

SVG not supported 1:27pm Mon 3rd Oct, Christopher M.

The filelist is a sequence of one-or-more whitespace separated 'words' on the command-line - e.g. file1 file2 dir1 file3 dir2 .... Just the same as the command-line arguments we have been passing to most commands all semester.

SVG not supported 1:25pm Mon 3rd Oct, Christopher M.

The project sheet says "Some example words are main, Australia, and GTHO351. The character sequence COVID-19 contains 2 words" Yes, you would store "jdskjdku". The project sheet does not mention the word "dictionary". Alphanumeric characters form t...

SVG not supported 1:20pm Mon 3rd Oct, Cohen R.

For the second prompt for building a file it mentions the names of files will be given by a filelist in the command prompt. I am unsure about what sort of formatting the filelist will have. Will the names of the files be space separated, comma separa...

SVG not supported 1:13pm Mon 3rd Oct, Cohen R.

Sorry, I didn't see that. Thank you

SVG not supported 1:12pm Mon 3rd Oct, Cohen R.

Are the words that can be stored in the dictionary words that are valid in a dictionary of words or any sequence of characters? (would you store something like jdskjdku). If it is just any sequence of characters, the task has outlined that it is onl...

SVG not supported 1:06pm Mon 3rd Oct, Christopher M.

"Getting started", point 11.

SVG not supported 12:49pm Mon 3rd Oct, Cohen R.

In the task it says the index file should be stored as a compressed file. The first thing that came to my mind was a hashtable. Does this count as a compressed file? I'm not sure about what a compressed file means. Thank you

SVG not supported 2:58am Mon 3rd Oct, Christopher M.

ANONYMOUS wrote (a reminder that this is an 'ideal' situation, one striving to make the index-file as small as possible). If you store each word only once overall, along with the files in which it occurs then, when searching for any word, you just de...

 UWA week 39 (2nd semester, week 9) ↓
SVG not supported 11:00pm Sun 2nd Oct, ANONYMOUS

Hi, In the index-file formatting section of the project brief, it specifies each indexed word should be ideally stored only once - I'd like to ask whether this is once for each file or once overall. Thanks.

SVG not supported 5:57pm Sun 2nd Oct, Christopher M.

The 2nd project is now available from https units CITS2002 projects project2.php The project may be undertaken individually, or in teams of two. You are strongly advised to undertake the project in a team, if possible. Comp...

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