home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / fortran / 4226 < prev    next >
Encoding:
Text File  |  1992-11-07  |  1.4 KB  |  52 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!sdd.hp.com!hp-col!hpfcnfs.sde.hp.com!pld
  3. From: pld@fc.hp.com (Paul_Dineen)
  4. Subject: Re: unformatted output: << SUMMARY >>
  5. Message-ID: <BxB3rw.KEy@fc.sde.hp.com>
  6. Sender: news@fc.sde.hp.com (Notes Administrator)
  7. Organization: HP CLO/CoLL, Fort Collins, CO
  8. X-Newsreader: TIN [version 1.1.4 PL6]
  9. References: <1992Nov5.111303.17921@uts.uni-c.dk>
  10. Date: Fri, 6 Nov 1992 18:09:31 GMT
  11. Lines: 39
  12.  
  13. In article 26525@chpc.utexas.edu, michael@chpc.utexas.edu (Michael Lemke) writes:
  14. >Doesn't have the record *number* to be stored at some place as well?  
  15. >Nothing stops you from doing
  16. >
  17. >         open( ,.... access='direct', .... )
  18. >         write( ..., rec=777 ) data
  19. >         write( ..., rec=32 ) mode_data
  20. >         close( ... )
  21. >
  22. >which gives you just two records of data and lots of `holes'.  Or am I
  23. >missing something?
  24.  
  25.  No.  You get holes.  For example, using HP Fortran on a 9.0 9000/750:
  26.  
  27. $ cat dw.f
  28.         open(10,file='holes',access='direct',recl=8)
  29.         write(10,rec=1000) 1, 2
  30.         i = 0
  31.         j = 0
  32.         read(10,rec=1000) i, j
  33.         print *, i, j
  34.         end
  35.  
  36. $ f77 dw.f
  37. dw.f:
  38.    MAIN:
  39.  
  40. $ a.out
  41.  1 2
  42.  
  43. $ ll holes
  44. -rw-rw-r--   1 pld      users       8000 Nov  6 11:06 holes
  45.  
  46. $ od -c holes
  47. 0000000  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
  48. *
  49. 0017460  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0 001  \0  \0  \0 002
  50. 0017500
  51.  
  52.