I'm trying to redirect stdout in the case of the append operator, ">>". When trying to open the correct file descriptor using the following line I get an error.
fd[1] = open(output_file, O_WRONLY|O_CREAT|O_APPEND, 0666);
When I try to compile my program I get these errors:
'O_WRONLY' undeclared (first use in this function)
'O_CREAT' undeclared (first use in this function)
'O_APPEND' undeclared (first use in this function)
I have included 'unistd.h' and 'fcnt1.h' since I thought those were the two header files I needed in order for the above line of code to work. But I don't really know why those file descriptor flags don't get recognized. Anyone have any suggestions?