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
explain_fflush_or_die(3)				     Library Functions Manual					  explain_fflush_or_die(3)

NAME
explain_fflush_or_die - flush a stream and report errors SYNOPSIS
#include <libexplain/fflush.h> void explain_fflush_or_die(FILE *fp); int explain_fflush_on_error(FILE *fp); DESCRIPTION
The explain_fflush_or_die function is used to call the fflush(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_fflush(3) function, and then the process terminates by calling exit(EXIT_FAILURE). The explain_fflush_on_error function is used to call the fflush(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_fflush(3) function, but still returns to the caller. fp The fp, exactly as to be passed to the fflush(3) system call. RETURN VALUE
The explain_fflush_or_die function only returns on success, see fflush(3) for more information. On failure, prints an explanation and exits, it does not return. The explain_fflush_on_error function always returns the value return by the wrapped fflush(3) system call. EXAMPLE
The explain_fflush_or_die function is intended to be used in a fashion similar to the following example: explain_fflush_or_die(fp); SEE ALSO
fflush(3) flush a stream explain_fflush(3) explain fflush(3) errors exit(2) terminate the calling process COPYRIGHT
libexplain version 0.52 Copyright (C) 2009 Peter Miller explain_fflush_or_die(3)
All times are GMT -4. The time now is 02:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy