February 2020
Beginner to intermediate
616 pages
15h 16m
English
We will start by defining a macro called BUFFSIZE of size 255 and a string called str of size BUFFSIZE, that is, 255 characters. We will open the FIFO special file named FIFOPipe in read-only mode by invoking the open function. The file descriptor of the opened FIFO special file will be assigned to the fr variable.
Using the read function, the text from the FIFO special file will be read and assigned to the str string variable. The text that's read from the FIFO special file will then be displayed on the screen. Finally, the FIFO special file will be closed.
Now, press Alt + F2 to open a second Terminal window. In the second Terminal window, let's use GCC to compile the readfifo.c program, as follows:
$ gcc readfifo.c -o readfifo ...
Read now
Unlock full access