-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui.cpp
More file actions
35 lines (28 loc) · 670 Bytes
/
gui.cpp
File metadata and controls
35 lines (28 loc) · 670 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{
int fd;
/*Log file initialization
FILE* f = fopen("/home/joseph/Documents/C_C++/Synk/guilog.txt", "w");
if (f == NULL)
{
printf("Error opening file!\n");
exit(1);
}*/
char* myfifo = "/tmp/synkFifo";
/* create the FIFO (named pipe) */
if (mkfifo(myfifo, 0666) < 0)
{
//fprintf(f, "Failed: mkfifo() raised an error.\n");
}
/* write "Hi" to the FIFO */
fd = open(myfifo, O_WRONLY);
write(fd, "Hi", sizeof("Hi"));
close(fd);
/* remove the FIFO */
unlink(myfifo);
return 0;
}