/MY PROGRAM ARE COMPILED IN FEDORA15 ..WITH 4.6 gcc compiler...../
/*A program showing writing of data into another file*/
#include<stdio.h>
#include<stdlib.h>
#include<fcntl.h>//to open() read() write() close() system calls
#include<unistd.h>
int main()
{
int fd,j;
printf("anu");
fd=1;j=1;
close(fd);//close(1)..will close stdout file..either file is closed in mid of the process...all stdout....statement will go into file opened after it....
printf("client%d",j);
fd=open("fd.c",O_WRONLY);//all output statements will come into this file ..& overite starting position of this file.....