Read from Linux named pipe - Mathematica

  • Context: Mathematica 
  • Thread starter Thread starter Swamp Thing
  • Start date Start date
  • Tags Tags
    Linux Pipe
Click For Summary
SUMMARY

This discussion addresses the challenges of reading from a Linux named pipe using Wolfram Mathematica. Users report that functions like FindFile and OpenRead return $Failed when attempting to access named pipes, indicating that Mathematica does not recognize them as regular files. Some users have successfully utilized named pipes with Mathematica, while others resort to alternative methods such as reading from sockets. The use of Duo Names is recommended for managing named pipes effectively in Mathematica.

PREREQUISITES
  • Familiarity with Linux named pipes and their creation using mkfifo
  • Basic understanding of Wolfram Mathematica and its file handling functions
  • Knowledge of inter-process communication methods in Linux
  • Experience with socket programming as an alternative to named pipes
NEXT STEPS
  • Explore the use of Duo Names for managing Linux named pipes in Mathematica
  • Investigate alternative methods for inter-process communication in Mathematica
  • Learn about socket programming in Linux for data exchange
  • Research community solutions for integrating Mathematica with named pipes
USEFUL FOR

This discussion is beneficial for Mathematica users, Linux developers, and anyone interested in implementing inter-process communication using named pipes in their applications.

Swamp Thing
Insights Author
Messages
1,047
Reaction score
780
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   Reactions: 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.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 21 ·
Replies
21
Views
6K
  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 3 ·
Replies
3
Views
6K