HP3000-L Archives

November 2000, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"TRAPP,RICH (Non-A-Loveland,ex1)" <[log in to unmask]>
Reply To:
TRAPP,RICH (Non-A-Loveland,ex1)
Date:
Fri, 17 Nov 2000 13:53:48 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (44 lines)
I think you can accomplish this same thing by doing a

  setbuf(stdout,0);

in the main() of the program. This disables the buffering and removes the
need for the fflush.

RAT

_______________________________________________________________________
 Rich Trapp "RAT"
 Managed Business Solutions   [log in to unmask]   http://www.mbsnav.com
 Assigned to Design Automation Support at Agilent Technologies
 Telnet or 970-679-2221 [log in to unmask]  Loveland, CO USA

_______________________________________________________________________

-----Original Message-----
From: Barry Lake [mailto:[log in to unmask]]
Sent: Friday, November 17, 2000 11:23 AM
To: [log in to unmask]
Subject: Re: C routine and $stdlist redirection


At 12:08 PM -0500 11/17/00, Emerson, Tom # El Monte wrote:
>I think someone else mentioned the difference in buffering -- tell your
>programmer to add explicit fflush(stdout) commands after printf's, that
>generally helps get the output out in the "expected" order.


Another very similar solution, if you don't want to add extra fflush()
statements to the program, is to change all printf("whatever") calls to
fprintf(stdout, "whatever").  This seems to force the output to be written
immediately...



Barry Lake                              [log in to unmask]
Allegro Consultants, Inc.               www.allegro.bogus.com
(408)252-2330
--------
Attempting to reduce spam influx.
Remove ".bogus" to create valid address.

ATOM RSS1 RSS2