home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / atari / st / tech / 6537 < prev    next >
Encoding:
Text File  |  1993-01-08  |  1.6 KB  |  39 lines

  1. Newsgroups: comp.sys.atari.st.tech
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!convex!rosenkra
  3. From: rosenkra@convex.com (William Rosenkranz)
  4. Subject: Re: Porting UNIX Code to the ST
  5. Message-ID: <1993Jan08.060247.12064@convex.com>
  6. Sender: usenet@convex.com (news access account)
  7. Nntp-Posting-Host: convex1.convex.com
  8. Organization: CONVEX Computer Corporation, Richardson, Tx., USA
  9. References: <1993Jan5.214420.8268@sae.com> <1993Jan7.124324.27805@its.bt.co.uk> <ENTROPY.93Jan7224017@kropotkin.gnu.ai.mit.edu>
  10. Date: Fri, 08 Jan 1993 06:02:47 GMT
  11. X-Disclaimer: This message was written by a user at CONVEX Computer
  12.               Corp. The opinions expressed are those of the user and
  13.               not necessarily those of CONVEX.
  14. Lines: 23
  15.  
  16. In article <ENTROPY.93Jan7224017@kropotkin.gnu.ai.mit.edu> entropy@gnu.ai.mit.edu (maximum entropy) writes:
  17. >Alternatively, the call:
  18. >
  19. >  _binmode(1);
  20. >
  21. >somewhere at the beginning of a program will cause all fopen()s to
  22. >default to binary mode (you can then force text mode with the "t"
  23. >modifier in the mode specifier.)  It's much easier, (and cleaner,
  24. >IMHO) to make this one small hack than to hunt down all the file mode
  25. >arguments all over a large program.
  26.  
  27. unfortunately, this does not effect stdin/stdout/stderr (which are set
  28. in the startup code). to make them binary, you have to set a global
  29. (which at the moment escapes me, something like int default_mode). i
  30. find setting the global even easier than using binmode(). for example
  31. i have made a binary cat, od, etc.
  32.  
  33. -bill
  34. rosenkra@convex.com
  35.  
  36. -- 
  37. Bill Rosenkranz            |UUCP: {uunet,texsun}!convex!rosenkra
  38. Convex Computer Corp.      |ARPA: rosenkra@convex.com
  39.