home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15429 < prev    next >
Encoding:
Text File  |  1992-09-13  |  1.3 KB  |  43 lines

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