#include"stdio.h" int main() { FILE* fd; char buf[20]; fd = fopen("myOS", "r"); /* Checks for open success */ if((fork()) != 0) { fread(buf, 1, 10, fd); buf[5]='\0'; printf("\nParent : %s\n",buf); fclose(fd); } else { sleep(1); fread(buf, 1, 10, fd); buf[5]='\0'; printf("\nChild : %s\n",buf); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)