Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: stdin and stdout Date: Mon, 20 Jul 2015 12:56:00 -0700 Organization: None to speak of Lines: 28 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="12291"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HfwqntNL6ppjEmhpX/Cyx" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:UgAYrlgVwsAXmS6l4DBOhjVVaxU= sha1:FUWlXlqcWlB6HfJVuwUIxjo4JBE= Xref: csiph.com comp.lang.c:66051 Bartc writes: > On 20/07/2015 19:19, Keith Thompson wrote: >> Bartc 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 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 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"