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


Groups > comp.lang.c > #66051

Re: stdin and stdout

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: stdin and stdout
Date 2015-07-20 12:56 -0700
Organization None to speak of
Message-ID <lnbnf6fvsf.fsf@kst-u.example.com> (permalink)
References <moitgi$g2j$1@dont-email.me> <lnsi8ig09w.fsf@kst-u.example.com> <mojf3u$q45$1@dont-email.me>

Show all headers | View raw


Bartc <bc@freeuk.com> writes:
> On 20/07/2015 19:19, Keith Thompson wrote:
>> Bartc <bc@freeuk.com> writes:
>
>>> I thought there might be a function that returned the values or a
>>> pointer to them.
>>
>> There's no standard function that does this -- nor is there anything
>> stopping you from writing such a function yourself.
>
> How? (Other than solutions based on passing special files/paths to fopen.)

#include <stdio.h>

FILE *stdin_func(void)  { return stdin; }
FILE *stdout_func(void) { return stdout; }
FILE *stderr_func(void) { return stderr; }

I don't know enough about what you're doing to know whether that's a
solution.

[snip]

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

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