Hi, I get confused with the theory aspects of the course. Could you please have a look at my answer to the question? I'm not sure if I am just missing the mark entirely for this question. Do you think you could release some solutions for the writing ...
I'm also a bit confused about how exactly to write the function. I tried to write it (attached) but I am unsure how to return the exit status of an unsuccessful command. If we call execl() and it fails, does the child process just terminate completel...
I was wondering if we're allowed to post our answers for the practice exams here to get feedback?
For the code I've tried writing (attached), I just made an array using malloc(100000).
In these kinds of questions, is it reasonable to just allocate a r...
Hi there
Is there any chance you could release the solutions for the practice exams? It's still useful without solutions, but I think seeing them would make checking our understanding easier
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...
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(" ...
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...
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...
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...
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?
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...
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...
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...
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 ...
Hi, I am trying to write a function that will recursively traverse files and directories in a directory and collect the absolute path names of every file, and am having some issues.
1. I am basically just reusing the code from lecture 16 about directo...
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...
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...
When writing c programs (partially in regards to Project 1), if we know the functions we write are to manipulate global variables, is there a preference between
1. Writing more 'general' functions that takes parameters, which we then call in main and...
I am a bit confused as to the "system's standard library (providing OS, C, and POSIX functions)."
Would it be correct to say that all the header files we are allowed to include are contained in the following?
https en.cppreference.com w c header
http...
Hi I'm thinking about how to do the project, and was hoping to get a bit of help before the weekend commences. Any guidance with the following is appreciated
1. I am thinking that we only want to read the Estimate file once and somehow store its val...
Hello
I am attempting to do lab 2 and I am trying to work out the best ways to convert between different types. I can't seem to find a straight forward way to do it, so I'm wondering what the go-to ways are for the following
1. String Char to int (e....