#include<stdio.h>
#include<stdlib.h>
#include<fcntl.h>
int main()
{
int count,fd;
char buf[50];
fd=open(“filem.c”,O_RDONLY,S_IRWXU);
count=read(fd,buf,50);
if(fd<0)
{
perror(“open”);
exit(-1);
}
printf(“the value of count=%d and value of buf=%s”,count,buf);
close(fd);
}
note :- where file : filem.c contain data “she sells sea shell at sea shore”