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/fclose.tm.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 fclose Context: slangrtl

Synopsis

Close a file

Syntax

Integer_Type fclose (File_Type fp)

Description

The fclose function may be used to close an open file pointer fp. Upon success it returns zero, and upon failure it sets errno and returns -1. Failure usually indicates a that the file system is full or that fp does not refer to an open file.

Many C programmers call fclose without checking the return value. The S-Lang language requires the programmer to explicitly handle any value returned by a S-Lang function. The simplest way to handle the return value from fclose is to use it as:

     () = fclose (fp);
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.