i am using dup2 system call for redirecting the standard output to a file.
some text was redirected to file. then i closed the file. again i was printing some text on stdout, but it is writing to the file, but i want to print on stdout device, how can i write the program?
this is the program i had written:
fd = open("temp.txt", O_CREAT|O_RDWR|O_TRUNC, 0666);
fgets(buff, 80, stdin);
printf("I am printing the text on stdout\n");
Last edited by jayakrishna; 02-17-2008 at 10:23 PM.