Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rdemeter
GitHub Repository: rdemeter/so
Path: blob/master/lab5/fifoclient.c
221 views
1
#include <stdio.h>
2
#include <stdlib.h>
3
#define FIFO_FILE "myfifo"
4
5
int main(int argc, char* argv[])
6
{
7
FILE* fp;
8
if (argc != 2) {
9
fprintf(stderr,"USAGE %s [string]\n",argv[0]);
10
return 1;
11
}
12
13
if ( (fp = fopen(FIFO_FILE,"w")) == NULL ) {
14
perror("fopen");
15
return 1;
16
}
17
18
fprintf(fp,"%s",argv[1]);
19
fclose(fp);
20
return 0;
21
}
22
23