Hi everyone,
I was hoping some of you might be able to give me a bit of advice on a coding problem I've been battling with for the last while.
I have been given a program which I run as root:
# ./prog pipe1 &
An argument of the program was a named pipe that I had earlier created with:
$ mknod pipe1 p
From the command line, to get the program to do it's stuff, I do the following:
$ echo "DO SOMETHING" > pipe
When I do this, the program functions perfectly and does as expected.
In a thread of a program that I am writing in Java, I need to send this string to the pipe that the program is using.
I have tried everything that I can think of - running the above command as a new process from within Java, creating a PrintWriter to write to the pipe as if it were a file and many others.
Would anyone have any thoughts on the way to 'echo' information into this pipe?
All advice will be much appreciated.
Thanks,
7th
P.S.
I hope I have explained the problem well. Any questions, please don't hesitate to ask