In order to write to a new file , I do the following :
// some code
...
pfd[i][0] = open(argv[j+1],O_CREAT|O_WRONLY,0600);
Questions :
-
Is there a difference between using
openorfopen? -
How can I use
openfor opening an existing file inappendmode ?
openis for POSIX systems. It is not portable to other system.fopenis part of C standard, so it will work on all C implementation. I am ignoring the difference thatopenreturns a file descriptor wherefopenreturns aFILE *.Use
O_APPENDto open for append mode.