1
struct my_structure {
    char name[15]; /*thread name*/
    int pid; /* pid of the thread */
    int ppid; /* parent pid of the thread */
};

struct my_structure m1[]={{"skier",12,14},{"skier1",13,14}};

I want to display the contents of these these structure instances in a table in Qt using QTableView. so want to pass this structured data to my Qt program through a named pipe/fifo.

Please guide me how to pass this structured data in my Qt program through named pipe/fifo and how to read the contents of the structure from the fifo so that i could display them in a QTableView. also suggest me the code for displaying the contents of the structure in a table.

sashoalm
  • 75,001
  • 122
  • 434
  • 781

1 Answers1

0

use fopen("/path/to/named-pipe",....) & then fread/fwrite or

use open("/path/to/named-pipe",....) & then read/write.

You can read/write the fifos in same manner as simple files.

For non-blocking IO, refer : How do I perform a non-blocking fopen on a named pipe (mkfifo)?

Community
  • 1
  • 1
anishsane
  • 20,270
  • 5
  • 40
  • 73