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

Discussion in 'Perl Misc' started by Andreas Persson, Mar 2, 2004.

  1. 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
    Andreas Persson, Mar 2, 2004
    #1
    1. Advertising

  2. On Tue, 02 Mar 2004 18:52:29 +0000, Andreas Persson wrote:

    > 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
    James Willmore, Mar 3, 2004
    #2
    1. Advertising

  3. On Wed, 03 Mar 2004 00:17:47 -0500, James Willmore wrote:

    >
    > 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
    Andreas Persson, Mar 3, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VmlqYXk=?=

    Parser Error Message: Could not load type 'PTS.Global'.

    =?Utf-8?B?VmlqYXk=?=, May 25, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,446
    Brock Allen
    May 25, 2005
  2. David Lozzi
    Replies:
    3
    Views:
    1,907
    David Lozzi
    Jun 1, 2005
  3. Charlie Zender

    Reading stdin once confuses second stdin read

    Charlie Zender, Jun 19, 2004, in forum: C Programming
    Replies:
    6
    Views:
    756
    Dan Pop
    Jun 21, 2004
  4. Alexander Newald

    Open /dev/pts/x or HANDLE read/write interactive?

    Alexander Newald, Jan 15, 2004, in forum: Perl Misc
    Replies:
    5
    Views:
    606
    Tad McClellan
    Jan 15, 2004
  5. Sarbjit singh
    Replies:
    2
    Views:
    367
    Nobody
    Jul 23, 2012
Loading...

Share This Page