It's UWAweek 48

help2002

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 2 other people reading this forum.


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

Login to reply

👍?
helpful
3:34am Wed 5th Oct, Christopher M.

ANONYMOUS wrote:
> 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 the type of file) it would be legal?
(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.
> 2)I've been trying to understand how realpath() works but it seems to work provided that the relative path is in the same directory as the program (correct me if i am wrong). I am having difficulty trying to use this function to find files that are in different directories so some clarification would be great!!
#define _DEFAULT_SOURCE

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    char absolute_path[1024];

    realpath( ".", absolute_path );
    printf("%s\n", absolute_path);

    return 0;
}
> 3) is the trovefile input just the file name or it could be a path to the file?
If the trove-file is in the current directory you could use: ./trove -f my_trove_file .... or: ./trove -f ./my_trove_file .... or if it's somewhere else you could use: ./trove -f /User/me/cits2002/project2/my_trove_file ....

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