Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #66002

Re: stdin and stdout

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c
Subject Re: stdin and stdout
Date 2015-07-20 16:29 +0100
Organization A noiseless patient Spider
Message-ID <87615e7spu.fsf@bsb.me.uk> (permalink)
References <moitgi$g2j$1@dont-email.me> <moiune$kf5$1@dont-email.me> <moj0kh$s4r$1@dont-email.me>

Show all headers | View raw


Bartc <bc@freeuk.com> writes:
<snip>
> But I now recall that opening a file called "con" under Windows will
> return a file handle that writes to the console. Trying it, this does
> seem to work:
>
>  f = fopen("con", "rb");      // similar to stdin
>  f = fopen("con", "wb");      // similar to stdout
>
> Although they are distinct from stdin and stdout. (I don't know what
> happens when someone wants to create a file actually called "con".)
>
> Now I all I need is a similar magic path in Linux and I'm all set..

  fopen("/dev/stdin", "rb");

It's not the same as "con" because it seems to be what you actually
want, but there are are Linux devices similar to Window's "con" if you
prefer.

-- 
Ben.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

stdin and stdout Bartc <bc@freeuk.com> - 2015-07-20 14:37 +0100
  Re: stdin and stdout Richard Heathfield <rjh@cpax.org.uk> - 2015-07-20 14:58 +0100
    Re: stdin and stdout Bartc <bc@freeuk.com> - 2015-07-20 15:31 +0100
      Re: stdin and stdout Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-07-20 16:29 +0100
        Re: stdin and stdout Bartc <bc@freeuk.com> - 2015-07-20 17:03 +0100
      Re: stdin and stdout Ken Brody <kenbrody@spamcop.net> - 2015-07-20 12:09 -0400
      Re: stdin and stdout Lőrinczy Zsigmond <zsiga@nospam.for.me> - 2015-07-21 10:02 +0200
  Re: stdin and stdout Keith Thompson <kst-u@mib.org> - 2015-07-20 11:19 -0700
    Re: stdin and stdout Bartc <bc@freeuk.com> - 2015-07-20 19:38 +0100
      Re: stdin and stdout Keith Thompson <kst-u@mib.org> - 2015-07-20 12:56 -0700
        Re: stdin and stdout Bartc <bc@freeuk.com> - 2015-07-20 23:06 +0100
          Re: stdin and stdout glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-07-20 23:18 +0000
            Re: stdin and stdout BGB <cr88192@hotmail.com> - 2015-07-21 14:12 -0500
          Re: stdin and stdout gordonb.9oj0u@burditt.org (Gordon Burditt) - 2015-07-21 19:14 -0500
            Re: stdin and stdout Bartc <bc@freeuk.com> - 2015-07-22 11:11 +0100
              Re: stdin and stdout gordonb.3xos3@burditt.org (Gordon Burditt) - 2015-07-22 20:05 -0500
                Re: stdin and stdout Bartc <bc@freeuk.com> - 2015-07-23 09:27 +0100
          Re: stdin and stdout Richard Damon <Richard@Damon-Family.org> - 2015-07-21 21:44 -0400
            Re: stdin and stdout glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-07-22 04:10 +0000
      Re: stdin and stdout BGB <cr88192@hotmail.com> - 2015-07-21 12:55 -0500
        Re: stdin and stdout Bartc <bc@freeuk.com> - 2015-07-21 20:49 +0100
          Re: stdin and stdout BGB <cr88192@hotmail.com> - 2015-07-22 00:05 -0500
            Re: stdin and stdout "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-07-22 02:48 -0700
              Re: stdin and stdout "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-07-22 02:57 -0700
                Re: stdin and stdout gordonb.bjmxp@burditt.org (Gordon Burditt) - 2015-07-22 20:27 -0500
              Re: stdin and stdout BGB <cr88192@hotmail.com> - 2015-07-22 13:19 -0500
                Re: stdin and stdout Robert Wessel <robertwessel2@yahoo.com> - 2015-07-22 18:09 -0500

csiph-web