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

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!uimrl7.mrl.uiuc.edu!ercolessi
  3. From: ercolessi@uimrl3.mrl.uiuc.edu (furio ercolessi)
  4. Subject: Re: flushing output in f77
  5. References:  <141324@lll-winken.LLNL.GOV>
  6. Message-ID: <Bxn2r5.7Mw@news.cso.uiuc.edu>
  7. Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
  8. Reply-To: ercolessi@uimrl3.mrl.uiuc.edu (furio ercolessi)
  9. Organization: MRL - UIUC
  10. Date: Fri, 13 Nov 1992 05:18:39 GMT
  11. Keywords: flush,i/o
  12. Lines: 31
  13.  
  14. In article <141324@lll-winken.LLNL.GOV>, sterne@dublin.llnl.gov (Philip Sterne) writes:
  15. |>Is there a clean standard-conforming way of emptying the write
  16. |>buffer for a unit in f77?  
  17. |>  [...]
  18. |>
  19. |>I could use flush, but that appears to be architecture dependent.
  20. |>
  21. |>At the moment, the best (portable) plan I can come up is to open, 
  22. |>write and close some file for each iteration.  
  23. |>
  24. |>Is there a better way?  For example, does a REWIND force a flush?
  25. |>Or is this vendor dependent?  The standard doesn't seem to address 
  26. |>this question.  
  27.  
  28. i had this very same problem and examined it some months ago
  29. by posting in this group.  yes, the solution is vendor-dependent
  30. and there is no standard solution.
  31. for the platform i was interested in, AIX on RS6000, it seems that
  32. you have to close and reopen.  i am using a routine that i call
  33. as CALL FLUSH(unit), just as in DECfortran and other 
  34. architectures, which internally INQUIREs the file, discovers
  35. what the name is, closes it and reopens it.  So my source is
  36. sort of "portable" now, at least between DEC and IBM RISCs.   
  37. If you are interested in the routine email me
  38. and i will send you the source (or post it here).
  39. furio 
  40. --
  41. Furio Ercolessi
  42. Materials Research Laboratory           |   Intl School for Advanced Studies
  43. Univ. of Illinois at Urbana-Champaign   |   Trieste, Italy
  44. furio@uiuc.edu                          |   furio@sissa.it
  45.