[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: read system call.



 Lakshmi Gopinath molested the spacetime to project in our dimension:
>    if (fd = (open("/root/data",O_RDONLY,0) < 0))
this line should be if((fd=open("/root/data",O_RDONLY))<0)
your brackets are misplaced :-)
>     {
>       printf("\n %s",strerror(errno));
>       exit(-1);
>     }
>    bzero(buff,10);
this would need string.h and so would strerror
>    while(count = (read(fd,buff,sizeof(buff))) > 0)
>        {
>          printf("\n %s ",buff);
>          printf("\n %d",count);
>          bzero(buff,10);
>        }
return here
>  }
>
Hope this works now 
Shishir
-- 

   "That's the problem with nature, something's always stinging you
   or oozing mucous all over you. Let's go and watch TV."
              --- Calvin