if(read(fd,buf,sizeof(buf)) == -1){ printf("failed\n"); } else{ printf("%s\n",buf); }