home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!news.centerline.com!noc.near.net!news.cs.brandeis.edu!news!aland
- From: aland@chaos.cs.brandeis.edu (Alan D.)
- Subject: Re: IO ReDirection in Think C
- In-Reply-To: bpb9204@tamsun.tamu.edu's message of Sat, 12 Sep 1992 06: 17:19 GMT
- Message-ID: <ALAND.92Sep13202414@chaos.cs.brandeis.edu>
- Sender: news@news.cs.brandeis.edu (USENET News System)
- Organization: Organization is for those who don't like chaos
- References: <yjc-110992221032@b61539.student.cwru.edu>
- <1992Sep12.061719.4937@tamsun.tamu.edu>
- Date: Mon, 14 Sep 1992 01:24:14 GMT
- Lines: 29
-
- In article <1992Sep12.061719.4937@tamsun.tamu.edu> bpb9204@tamsun.tamu.edu (Brent) writes:
-
- >yjc@po.cwru.edu (Jerome Chan) writes:
- >|
- >| How does one activate the IO re-direction capabilities of the console
- >|package in ANSI library for Think C 5.0.x?
-
- >#include <Whateverfilesyouneedtoinclude.h>
- >#include <console.h>
-
- >main( int argc, char * argv[])
- >{
- > argc = ccommand( &argv);
-
- > // continue on here with the argument processing like normal
- >}
-
- Or, if you meant, how do you redirect std{in, out, err}, you can just
- use the standard ANSI C calls:
-
- FILE *freopen(const char *pathname, const char *type, FILE *stream);
-
- in other words, you would do:
-
- stdin = freopen(filename, "r", NULL);
-
- I think... Check the Think C manuals for exact info.
-
- -=Alan
-