this is a poorly worded title question and I apologize but I do not know the proper terminology.
I have a variable output formed by.. (it ends up being this way but these 4 lines aren't in order):
char cmd[50]
cmd = "test.txt"
char *output;
*output = cmd;
then I try to call open like:
int outfile;
outfile = open( output, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP );
but that does not work. However this works:
int outfile;
outfile = open( "test.txt", O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP );
I am assuming what is being stored in output is just 't' but I need all of it to make this work. Any ideas? The context of this is I am manually trying to do a redirect.