home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / atari / st / tech / 6588 < prev    next >
Encoding:
Internet Message Format  |  1993-01-11  |  1.5 KB

  1. Path: sparky!uunet!pipex!bnr.co.uk!uknet!fulcrum!its!silver.its.bt.co.uk!jvt
  2. From: jvt@its.bt.co.uk (John Trickey)
  3. Newsgroups: comp.sys.atari.st.tech
  4. Subject: Re: Porting UNIX Code to the ST
  5. Message-ID: <1993Jan11.165412.844@its.bt.co.uk>
  6. Date: 11 Jan 93 16:54:12 GMT
  7. References: <1993Jan5.214420.8268@sae.com> <1993Jan7.124324.27805@its.bt.co.uk> <ENTROPY.93Jan7224017@kropotkin.gnu.ai.mit.edu>
  8. Sender: @its.bt.co.uk
  9. Organization: BT Group Computing Services, Birmingham, UK
  10. Lines: 28
  11.  
  12. In article <ENTROPY.93Jan7224017@kropotkin.gnu.ai.mit.edu> entropy@gnu.ai.mit.edu (maximum entropy) writes:
  13. >
  14. >Alternatively, the call:
  15. >
  16. >  _binmode(1);
  17. >
  18. >somewhere at the beginning of a program will cause all fopen()s to
  19. >default to binary mode (you can then force text mode with the "t"
  20. >modifier in the mode specifier.)  It's much easier, (and cleaner,
  21. >IMHO) to make this one small hack than to hunt down all the file mode
  22. >arguments all over a large program.
  23.  
  24. Surely thats a bad as the first sin of using Unix specific modes in the
  25. original fopen(). All you have done is introduced another restriction to
  26. portability just because you cant't be bothered to look for all the fopen()
  27. calls :-) :-) You may find you have to hunt them out anyway as to assume
  28. all fopen()'s are binary is just ONE HELL OF AN ASSUMPTION.
  29.  
  30. A friendly Unix host or MinT would help:-
  31.  
  32. grep fopen *.[ch] | lpr
  33.  
  34. John
  35. -- 
  36. John Trickey <jvt@its.bt.co.uk>
  37.        Voice: +44 21 524 8200     Fax: +44 21 553 6120
  38. (Home) <john@its.bt.co.uk> || <john@g4rev.ampr.org> || G4REV @ GB7FLG
  39.        +44 21 308 8892
  40.