/dev/pts/x, /proc/x/fd, reading stdout, writing stdin, not with open3

  • Thread starter Andreas Persson
  • Start date
A

Andreas Persson

Hi

are there any perl gods out there that could help me. :)

is it possible to open(?) /dev/pts/x that another program
has created/using/virtual_console and read its stdout and let me write to
its stdin?

is it possible to use /proc/$pid/fd/x in some way?

the only way i've found to work is with open3 call, but this not
nice to the program that needs to be running 24/7. :)


any tips/hints are very welcome, both on a perl solution and general info
on /dev/pts/ and /proc/$pid/fd/.

/Andreas
 
J

James Willmore

are there any perl gods out there that could help me. :)

is it possible to open(?) /dev/pts/x that another program
has created/using/virtual_console and read its stdout and let me write to
its stdin?

is it possible to use /proc/$pid/fd/x in some way?

the only way i've found to work is with open3 call, but this not
nice to the program that needs to be running 24/7. :)


any tips/hints are very welcome, both on a perl solution and general info
on /dev/pts/ and /proc/$pid/fd/.

Can you, instead, redirect or `tee` the output of the application you're
trying to monitor to a fifo and then let the script read that instead of
the virtual console?

HTH

--
Jim

Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.

a fortune quote ...
In a medium in which a News Piece takes a minute and an
<"In-Depth" Piece takes two minutes, the Simple will drive out
the Complex. -- Frank Mankiewicz
 
A

Andreas Persson

Can you, instead, redirect or `tee` the output of the application you're
trying to monitor to a fifo and then let the script read that instead of
the virtual console?

never tested to write to the fifo(client)(i really need this), but if i do
something bad like closing the fifo, the server app process gets killed.
thats why i continued to look for another solution..

the server application(no source availble) needs to be accesible by admins
and running 24/7.

is it possible to do what im trying to do?
or what can i do?

any help are welcome.

(i really hope this doesnt 'top posts', first time on this news client,
sorry if it does)
/Andreas
 

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
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top