home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.ultrix:5975 comp.lang.c:11765
- Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!ohstpy!smithj
- From: smithj@ohstpy.mps.ohio-state.edu
- Newsgroups: comp.unix.ultrix,comp.lang.c
- Subject: File Buffering Problem
- Message-ID: <13173.2a77e2b1@ohstpy.mps.ohio-state.edu>
- Date: 30 Jul 92 12:38:09 EDT
- Lines: 36
-
- Hello.
- I have written a C program on a DecStation 5000 series running Ultrix 4.2A.
- I am using GnuC 1.37 but could use the Dec cc or c89 if I had to. The program
- runs for a long time (min 15 hrs.) and writes log files during its run.
- The log files fall into three categories:
-
- A. Ones written by my program
- B. Ones written by subroutines for which I don't have source code
- C. Ones written by pipes from scripts that my program runs
-
- It's not uncommon that the program will hang requiring a Ctrl-C to end it or
- that I want to see its progress by looking at the log files. The problem is
- that the log files are not getting written immediately and a Ctrl-C looses them
- completely. With regards to the three types of logs:
-
- A. I have tried using the fflush(stream) function but apparently this only
- flushes the C file buffer and not the Ultrix one since nothing gets written.
- I could concievable open and close the file every time I write to it but I'd
- like a cleaner solution.
- B. I'm not sure if this is solvable at all.
- C. Is there any way to force piping output to get flushed as it's being
- written?
-
- I would appreciate any help. Please respond by e-mail.
- Thanx.
- --
- I knew how the game was going to end when I took Brenda
- into the filing room but I took her in anyway. --Al
- They have one big advantage over us:
- *they* know where they're going. --Batman
- Has your family tried 'em, Powdermilk? --Garrison Keillor
-
- /* Jeffery G. Smith, BS-RHIT (AKA Doc. Insomnia, WMHD-FM) *
- * The Ohio State University, Graduate Physics Program *
- * 2029 Smith Lab, Columbus, OH 43210 (614) 292-6799 *
- * smithj@ohstpy.mps.ohio-state.edu */
-