Find the answer to your Linux question:
Results 1 to 3 of 3
I have a simple C program that processes a input either from file or from stdin. I want to be able to talk to the user (print messages and get ...
  1. #1
    Just Joined!
    Join Date
    Sep 2008
    Location
    Silicon Forest, Oregon
    Posts
    4

    Terminal window device name

    I have a simple C program that processes a input either from file or from stdin.

    I want to be able to talk to the user (print messages and get keyboard input) even when stdin has been redirected to a file.

    I figure a need a device name, but have been unable to find one the will work.

    Running in a DOS box under Windows the name "con" works.

    I have tried "con", "console", "/dev/console" under Linux, but none of these names work.

  2. #2
    Just Joined!
    Join Date
    Feb 2009
    Location
    location, location
    Posts
    18
    Does /dev/tty0 work?

    Text-Terminal-HOWTO: Terminal Special Files such as /dev/tty : see section 6.5

  3. #3
    Just Joined!
    Join Date
    Sep 2008
    Location
    Silicon Forest, Oregon
    Posts
    4
    Thanks for the suggestion, but no, /dev/tty0 does not work.
    I've tried several different names, but no luck so far.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...