#include<unistd.h>
#include<stdio.h>
#include<fcntl.h>
char string[]="patel";
int main(char argv[10][100],int argc)
{
int fd;
char buf[200];
mknod("fifo",010777,0);
if(argc == 2)
fd=open("fifo",O_WRONLY);
else
fd=open("fifo",O_RDONLY);
while(1)
{
if(argc==2)
{ printf("writing");
write(fd,string,6);
}
else
{
printf("Reading");
read(fd,buf,6);
printf("read string : %s ",buf);
}
}
}