home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / programm / 4018 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  2.1 KB

  1. Xref: sparky comp.unix.programmer:4018 comp.unix.questions:9583 comp.unix.shell:3209
  2. Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!ohstpy!smithj
  3. From: smithj@ohstpy.mps.ohio-state.edu
  4. Newsgroups: comp.unix.programmer,comp.unix.questions,comp.unix.shell
  5. Subject: File Buffering Problem
  6. Message-ID: <13172.2a77e21e@ohstpy.mps.ohio-state.edu>
  7. Date: 30 Jul 92 12:35:42 EDT
  8. Lines: 36
  9.  
  10. Hello.
  11. I have written a C program on a DecStation 5000 series running Ultrix 4.2A.
  12. I am using GnuC 1.37 but could use the Dec cc or c89 if I had to.  The program
  13. runs for a long time (min 15 hrs.) and writes log files during its run.
  14. The log files fall into three categories:
  15.  
  16.     A. Ones written by my program
  17.     B. Ones written by subroutines for which I don't have source code
  18.     C. Ones written by pipes from scripts that my program runs
  19.  
  20. It's not uncommon that the program will hang requiring a Ctrl-C to end it or
  21. that I want to see its progress by looking at the log files.  The problem is
  22. that the log files are not getting written immediately and a Ctrl-C looses them
  23. completely.  With regards to the three types of logs:
  24.  
  25. A. I have tried using the fflush(stream) function but apparently this only
  26.    flushes the C file buffer and not the Ultrix one since nothing gets written.
  27.    I could concievable open and close the file every time I write to it but I'd
  28.    like a cleaner solution.
  29. B. I'm not sure if this is solvable at all.
  30. C. Is there any way to force piping output to get flushed as it's being
  31.    written?
  32.  
  33. I would appreciate any help.  Please respond by e-mail.
  34. Thanx.
  35. -- 
  36. I knew how the game was going to end when I took Brenda
  37.     into the filing room but I took her in anyway.      --Al
  38. They have one big advantage over us:
  39.     *they* know where they're going.                    --Batman
  40. Has your family tried 'em, Powdermilk?                  --Garrison Keillor
  41.  
  42. /* Jeffery G. Smith, BS-RHIT (AKA Doc. Insomnia, WMHD-FM)       *
  43.  *    The Ohio State University, Graduate Physics Program       *
  44.  *        2029 Smith Lab, Columbus, OH 43210  (614) 292-6799    *
  45.  *    smithj@ohstpy.mps.ohio-state.edu                          */
  46.