Question about names??

What is the meaning of the following:

stdin
stdout
stderr


what do each of them mean....I'm confused??


thanks

Comments

  • stdin or standard input (typically the keyboard)
    stdout or standard output (typically the screen)
    stderr or standard error (typically the screen)

    The above are "streams" for transporting information between your users (input), the program itself, and then a display (output) of the data manipulated or acted upon during the execution of the program.


    : What is the meaning of the following:
    :
    : stdin
    : stdout
    : stderr
    :
    :
    : what do each of them mean....I'm confused??
    :
    :
    : thanks
    :

  • : What is the meaning of the following:
    :
    : stdin
    : stdout
    : stderr
    :
    :
    : what do each of them mean....I'm confused??
    :
    :
    : thanks
    :

    In a nutshell they are handles that point to the input and output "devices". Normally stdin refers to the keyboard and stdout and stderr refer to the screen.

    However there are times that this isn't the case. I use "dumb" ansi terminals in the course of my work. They are simple RS-232 devices. For the development of the programs, I hook a regular monitor and keyboard to the onboard computer. All input and output come and go through these devices.

    After development, I need all I/O to go through the ansi terminal. This is done in DOS with the CTTY command which redefines what stdin and stdout are pointing to, but from the programs point of view it is all still coming from and going to stdin and stdout. I personally do not know of a reason to redirect stderr, so can't help there.


  • Besides of what was said I would add that stderr is not redirectable; stdin and stdout are.
  • : Besides of what was said I would add that stderr is not redirectable; stdin and stdout are.
    :

    In *nix stderr can be redirected to a file, but I don't remember the exact syntax. I've tried to redirect it in MS-DOS and MS-Windows but it doesn't work.
  • : : Besides of what was said I would add that stderr is not redirectable; stdin and stdout are.
    : :
    :
    : In *nix stderr can be redirected to a file, but I don't remember the exact syntax. I've tried to redirect it in MS-DOS and MS-Windows but it doesn't work.
    :

    Not that this cannot be found via web search, but
    here are few examples that show how stderr can be
    redirected:

    >/pathto/stdout.txt 2>/pathto/stderr.txt
    >/pathto/outerr.txt 2>&1

    >& is how aliasing is established.

    Note that the shell also matters i.e. the syntax
    also depends on what shell it is (bourne shell or
    c shell or else).
  • : Besides of what was said I would add that stderr is not redirectable; stdin and stdout are.
    :

    In embedded systems, there is the case when you don't redirect stdin or stdout to make them appear on for example an RS-232 serial interface.
    They are simply made to point by default at the serial interface from the compiler implementation of the platform. This is perfectly legal with the C standard, sence it doesn't mention things like screens or keyboards. Same goes for stderr, it might also be directed to an external device by default.
  • : : : Besides of what was said I would add that stderr is not redirectable; stdin and stdout are.
    : : :
    : :
    : : In *nix stderr can be redirected to a file, but I don't remember the exact syntax. I've tried to redirect it in MS-DOS and MS-Windows but it doesn't work.
    : :
    :
    : Not that this cannot be found via web search, but
    : here are few examples that show how stderr can be
    : redirected:
    :
    : >/pathto/stdout.txt 2>/pathto/stderr.txt
    : >/pathto/outerr.txt 2>&1
    :
    : >& is how aliasing is established.
    :
    : Note that the shell also matters i.e. the syntax
    : also depends on what shell it is (bourne shell or
    : c shell or else).
    :


    IIrc, you use SetStdHandle() to do it in Windows. Should work for any of the three.

  • : In embedded systems, there is the case when you don't redirect stdin or stdout to make them appear on for example an RS-232 serial interface.
    : They are simply made to point by default at the serial interface from the compiler implementation of the platform.

    Some PC-104 cards that I have worked with have also included a jumper that would redirect all console input/output to the serial port, eliminating the need to do it from dos. I suspect they included this feature in the event of somebody using an operating system that did not include a facility to redirect I/O.
  • : : : : Besides of what was said I would add that stderr is not redirectable; stdin and stdout are.
    : : : :
    : : :
    : : : In *nix stderr can be redirected to a file, but I don't remember the exact syntax. I've tried to redirect it in MS-DOS and MS-Windows but it doesn't work.
    : : :
    : :
    : : Not that this cannot be found via web search, but
    : : here are few examples that show how stderr can be
    : : redirected:
    : :
    : : >/pathto/stdout.txt 2>/pathto/stderr.txt
    : : >/pathto/outerr.txt 2>&1
    : :
    : : >& is how aliasing is established.
    : :
    : : Note that the shell also matters i.e. the syntax
    : : also depends on what shell it is (bourne shell or
    : : c shell or else).
    : :
    :
    :
    : IIrc, you use SetStdHandle() to do it in Windows. Should work for any of the three.
    :
    :


    Yea, just found a project that redirects stdin stdout and stderr to a window.

    http://codeproject.com/dialog/quickwin.asp

    [italic][blue]To understand recursive, first you need to understand recursive[/blue][/italic]

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories