Matlab read from named pipe (fifo)

2019-07-09 02:20发布

问题:

I am having trouble reading from a named pipe/fifo in matlab under linux.

textread() on the pipe always returns "Empty matrix: 0-by-1". textread() blocks until data was written to the pipe.

If I use fopen() and fscanf(), then fopen will block until it receives some data. The first call to fscanf() will return the written data, and all subsequent calls of fscanf() return nothing (e.g. '') without blocking.

fread() behaves as fscanf()

fgets() returns -1

Anyone knows how to read from a pipe?

标签: matlab pipe fifo