Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Answer: Changing tty's in perl

( #104174=categorized answer: print w/ replies, xml ) Need Help??

Q&A > input and output > Changing tty's in perl contributed by kjherron

The posix way to obtain a new controlling tty is to first get rid of the old one, as you've outlined, and then open a new one; the first one opened becomes the new controlling tty. You can't use "/dev/tty" for this purpose of course, you'd have to open a real tty device. These are /dev/pty*, /dev/console, and devices corresponding to actual serial ports.

Is the program insisting on a tty, or just a valid stdin? Instead of just closing stdin/stdout/stderr you can try opening them to /dev/null, and see if that is sufficient. If it needs a tty, one can often use /dev/console.

Comment on Answer: Changing tty's in perl
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (12)
As of 2014-08-28 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (264 votes), past polls