read (C System Call)

#include<fcntl.h>
int main()
{
int fd,rd;
char buff[4096];
fd=open("test.txt",O_WRONLY|O_APPEND|O_RDONLY);
if(fd>1)
{
printf("%d",fd);
//write(fd,"1233456",9);
rd=read(fd,buff,4096);
printf("%d",rd);
write(1,buff,1);
printf("%s",rd);
}
return 0;

}

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License