I want to open a file for write and I have been given the file descriptor for that file.
I know that fdopen can be used to write to the file as follows:
FILE * fp;
fp = fdopen(filedes, "a+");
fwrite("\n", sizeof(char), 1, fp);
Is there any other way to achive the same, i.e., write to a file given a file descriptor?
Thanks
You can write directly using the system call
write(2).