13 This function closes the open file associated with the descriptor fd.
14 When this is done, the file value associated with the file remains
15 a file value, but appears 'closed', and cannot be used in further
16 file-related calls (except fclose) without causing errors. This same
17 action occurs to all copies of the file value. You do not need to
18 explicitly close all the copies of a file value.
20 Standard input, standard output and standard error are always opened
23 The truth value of a closed file is FALSE.
25 The fclose function returns the numeric value of errno if
26 there had been an error using the file, or the null value if
29 Closing a closed file is permitted. Fclose returns null in
33 ; fd = fopen("/etc/motd", "r")
34 ; if (fd) print "file is open";
38 ; if (isnull(err)) print "close successful"; else strerror(err);
41 ; if (!fd) print "file is closed";
45 fd != files(0) && fd != files(1) && fd != files(2)
51 errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen,
52 fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt
54 ## Copyright (C) 1999-2006 Landon Curt Noll
56 ## Calc is open software; you can redistribute it and/or modify it under
57 ## the terms of the version 2.1 of the GNU Lesser General Public License
58 ## as published by the Free Software Foundation.
60 ## Calc is distributed in the hope that it will be useful, but WITHOUT
61 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
62 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
63 ## Public License for more details.
65 ## A copy of version 2.1 of the GNU Lesser General Public License is
66 ## distributed with calc under the filename COPYING-LGPL. You should have
67 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
68 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
70 ## @(#) $Revision: 30.1 $
71 ## @(#) $Id: fclose,v 30.1 2007/03/16 11:10:42 chongo Exp $
72 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fclose,v $
74 ## Under source code control: 1994/10/27 03:04:16
75 ## File existed as early as: 1994
77 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
78 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/