About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/fflush.tm.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 fflush Context: slangrtl

Synopsis

Flush an output stream

Syntax

Integer_Type fflush (File_Type fp)

Description

The fflush function may be used to update the output stream specified by fp. It returns 0 upon success, or -1 upon failure and sets errno accordingly. In particular, this function will fail if fp does not represent an output stream, or if fp is associated with a disk file and there is insufficient disk space.

Example

This example illustrates how to use the fflush function without regard to the return value:

    () = fputs ("Enter value> ", stdout);
    () = fflush (stdout);

Many C programmers disregard the return value from the fflush function. The above example illustrates how to properly do this in the S-Lang langauge.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.