Sponsored Content
Full Discussion: GDB - Realtime output
Top Forums Programming GDB - Realtime output Post 302505703 by Corona688 on Thursday 17th of March 2011 03:33:24 PM
Old 03-17-2011
Again, that's because printf() buffers -- it holds everything in memory until you print an \n (or until you quit) then prints it all.

If you print to standard error like fprintf(stderr, ...); that won't buffer.

You can also force standard output to flush its buffer whenever you want with fflush(stdout).
This User Gave Thanks to Corona688 For This Post:
 

2 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

compare realtime

I have two log files which keeps appending every sec...I want to extract a certain field from each file(using awk for extracting the data) and compare them in real time... ex: log1 122 234 567 log2 234 567 log3 122 i need a log3 which keeps appending the data found in log1 and... (7 Replies)
Discussion started by: wannalearn
7 Replies

2. Shell Programming and Scripting

Copying files realtime

I have a primary server where certain files are created real time. These files have varying file sizes. I want to FTP or copy them over to a different server server as soon a file gets created. I have to ensure that only full file is copied. The receiving end process expects a FULL file. I am ok... (3 Replies)
Discussion started by: vskr72
3 Replies
flush(3tcl)						       Tcl Built-In Commands						       flush(3tcl)

__________________________________________________________________________________________________________________________________________________

NAME
flush - Flush buffered output for a channel SYNOPSIS
flush channelId _________________________________________________________________ DESCRIPTION
Flushes any output that has been buffered for channelId. ChannelId must be an identifier for an open channel such as a Tcl standard channel (stdout or stderr), the return value from an invocation of open or socket, or the result of a channel creation command provided by a Tcl extension. The channel must have been opened for writing. If the channel is in blocking mode the command does not return until all the buffered output has been flushed to the channel. If the chan- nel is in nonblocking mode, the command may return before all buffered output has been flushed; the remainder will be flushed in the back- ground as fast as the underlying file or device is able to absorb it. EXAMPLE
Prompt for the user to type some information in on the console: puts -nonewline "Please type your name: " flush stdout gets stdin name puts "Hello there, $name!" SEE ALSO
file(3tcl), open(3tcl), socket(3tcl), Tcl_StandardChannels(3tcl) KEYWORDS
blocking, buffer, channel, flush, nonblocking, output Tcl 7.5 flush(3tcl)
All times are GMT -4. The time now is 02:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy