home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / hp / 9436 < prev    next >
Encoding:
Internet Message Format  |  1992-08-19  |  998 b 

  1. Path: sparky!uunet!ogicse!hp-cv!hp-pcd!hpfcso!pld
  2. From: pld@hpfcso.FC.HP.COM (Paul Dineen)
  3. Newsgroups: comp.sys.hp
  4. Subject: Re: Re: Help for my binary read !!!
  5. Message-ID: <7371234@hpfcso.FC.HP.COM>
  6. Date: 19 Aug 92 00:02:18 GMT
  7. Article-I.D.: hpfcso.7371234
  8. References: <123040008@hpcupt3.cup.hp.com>
  9. Organization: Hewlett-Packard, Fort Collins, CO, USA
  10. Lines: 25
  11.  
  12. > > Dear netters:
  13. > >    I have the following c-code which reads in a binary file
  14. > >    generated by Fortran program write: write(10) n1,n2,n3,n4
  15. > >    (Here, n1=40,n2=60, n3=17, n4=1)
  16. > When Fortran does unformatted I/O, it puts a record length at the
  17.            ^
  18.         sequential
  19. > beginning and end of each record.
  20.  
  21.  
  22.  You can see what's in the file by using od(1):
  23.  
  24. > od -d xxx
  25. 0000000 00000 00016 00000 00040 00000 00060 00000 00017
  26. 0000010 00000 00001 00000 00016
  27. 0000018
  28.  
  29.  
  30.  If you used direct access then you wouldn't have to skip over the length
  31.  words:
  32.  
  33. > od -d yyy
  34. 0000000 00000 00040 00000 00060 00000 00017 00000 00001
  35. 0000020
  36.