communicate with named pipe

J

Jiansong Li

I am a newbie of this mailing place but I want to draw a gui for other
program via ruby. That program is written by C++ and creaded two pipe:
mkfifo(read_str,0600)
readfd=open(read_str,O_RDWR)
mkfifo(write_str,0600)
writefd=open(write_str,O_RDWR).
I serched all the subject through the mailing list but can't find useful
information to help me create a named pipe.
Who can give me a hand?
 
W

William Morgan

Excerpts from Jiansong Li's mail of 20 Feb 2005 (EST):
I am a newbie of this mailing place but I want to draw a gui for other
program via ruby. That program is written by C++ and creaded two pipe:
mkfifo(read_str,0600)
readfd=open(read_str,O_RDWR)
mkfifo(write_str,0600)
writefd=open(write_str,O_RDWR).
I serched all the subject through the mailing list but can't find useful
information to help me create a named pipe.

If the C++ program is creating the pipes, you can simply open them as
ordinary files from Ruby.

If you want to create the pipes from Ruby, you'll have to use a system
call:

path = "/path/to/fifo"
system("mkfifo #{path}")

Or wait for the patch in [ruby-talk:91735] to be integrated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,169
Messages
2,570,915
Members
47,456
Latest member
JavierWalp

Latest Threads

Top