/*A PROGRAM TO COMPARE 2 FILES & ENTER THE DIFFRENCE OF CHARACTERS IN 2 FILES INTO 3RD FILE*/
#include<stdio.h>
#include<fcntl.h>
int main()
{
char buff,set;
int fd1,fd2,wfd,count1=1,count2=1;
fd1=open("source1",O_RDONLY);//OPEN 1ST FILE TO READ
fd2=open("source2",O_RDONLY);//OPEN 2ND FILE TO READ
wfd=open("desti",O_WRONLY|O_CREAT);//OPEN 3RD FILE ..TO WRITE..& ALSO CREAT 3RD FILE..IN WHICH DIFFRENCE BETWEEN CHARACTERS OF 2 FILES MAY BE WRITTEN //
while(count1==1 && count2==1)// IF THERE IS ANY CHARACTER TO READ..THEN count1=1 & also count2=1
{
count1=read(fd1,&buff,1);//UNTILL IN ANY FILE ...THERE IS ANY CHARACTER TO READ THEN READ THAT CHARACTER& CHECK DIFFRENCE
count2=read(fd2,&set,1);
if(buff != set)//IF CHARACTER READ FROM 1ST FILE IS DIFFRENT THAN CHARACTER READ FROM 2ND FILE ...THEN THAT DIFFRENT LETTER OR CHARACTER IS PUT INTO 3RD FILE ..//