home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / c / 12688 < prev    next >
Encoding:
Internet Message Format  |  1992-08-13  |  1.2 KB

  1. Xref: sparky comp.lang.c:12688 comp.sys.sun.misc:3861
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!wupost!uwm.edu!ogicse!plains!news.u.washington.edu!milton!chuckb
  3. From: chuckb@milton.u.washington.edu (Chuck Bass)
  4. Newsgroups: comp.lang.c,comp.sys.sun.misc
  5. Subject: Re: How to use the same file of structs on PC and Sun?
  6. Message-ID: <chuckb.714624791@milton>
  7. Date: 24 Aug 92 02:53:11 GMT
  8. Article-I.D.: milton.chuckb.714624791
  9. References: <71527@apple.Apple.COM> <THOMAS.TORNBLOM.92Aug24013032@beck.nexus.comm.se>
  10. Sender: news@u.washington.edu (USENET News System)
  11. Organization: University of Washington
  12. Lines: 16
  13.  
  14. As has been previously stated having portable binary files is
  15. inherently not portable.  Big endian/Little endian, byte
  16. alignment, format of floats and size of ints, longs and shorts
  17. are a sample of what you have to contend with.
  18.  
  19. Unfortunately, the portable solution is to use ASCII files and
  20. read  your files as text using fscanf or some such mechanism.
  21. This is not an ideal solution if file size is of any concern.
  22.   
  23. Sorry if this isn't the answer that you wanted...
  24.  
  25.  
  26. Chuck Bass
  27. College of Forest Systems Engineering
  28. University of Washington
  29. chuckb@u.washington.edu
  30.