Mathematica Read from Linux named pipe - Mathematica

  • Thread starter Thread starter Swamp Thing
  • Start date Start date
  • Tags Tags
    Linux Pipe
AI Thread Summary
The discussion centers on the challenges of reading from a Linux named pipe in Wolfram/Mathematica. Despite successfully creating and testing the named pipe using standard Linux commands, attempts to access it through Mathematica's FindFile and OpenRead functions result in failures, likely due to Mathematica's filtering of non-regular files. Some users have previously managed to utilize named pipes with Mathematica, but others have resorted to alternative methods, such as using sockets with a helper program. The use of Duo Names is recommended for better management of named pipes, allowing for persistent connections and clearer communication between processes.
Swamp Thing
Insights Author
Messages
1,028
Reaction score
763
I have a named pipe :
Code:
mkfifo /home/pi/Desktop/gnuradio/PIPE



I can see the pipe in the Linux directory listing and also using Directory[] in Wolfram. I can test it in the console using echo and cat.

But Wolfram doesn't seem to see it:
Code:
In[10]:= FindFile["/home/pi/Desktop/gnuradio/PIPE"]
Out[10]= $Failed

OpenRead also gives "$Failed".

Is it possible to read from a Linux named pipe in Wolfram/Mathematica?
 
Last edited:
Physics news on Phys.org
  • Informative
Likes Swamp Thing
You can use Duo Names to simplify managing Linux named pipes when integrating with Mathematica. For instance, setting up a persistent pipe and assigning descriptive names ensures smoother communication between processes.
 
Back
Top