//pipe/client.с #include #include #include #include #include #include #include #define MAXLINE 180 void client(char * read, char * write) { size_t len; ssize_t n; FILE *readfd, *writefd; char buff[MAXLINE]; //printf("Descriptors: read:%p, write:%p\n",readfd,writefd); /* получение полного имени файла */ printf("Client wait filename:"); //fgets(buff, MAXLINE, stdin); gets(buff); len = strlen(buff); /* fgets() гарантирует завершающий нулевой байт */ printf("Client sending %s\n",buff); writefd=fopen(write,"w"); fputs(buff,writefd); //n=fprintf(writefd, "%s",buff); printf("Client wait responce!\n"); fclose(writefd); readfd=fopen(read,"r"); printf("Responce:\n"); /* считывание из канала, вывод в stdout */ while //( fgets(buff,80,readfd)) ((fgets(buff,MAXLEN,readfd))) printf("%s",buff); }