failed attempts to intercept copy command when the cursor is in the empty text field...
[LeanCalc.git] / help / fclose
1 NAME
2     fclose - close a file
3
4 SYNOPSIS
5     fclose(fd)
6
7 TYPES
8     fd          file
9
10     return      nul or int
11
12 DESCRIPTION
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.
19
20     Standard input, standard output and standard error are always opened
21     and cannot be closed.
22
23     The truth value of a closed file is FALSE.
24
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
27     there was no error.
28
29     Closing a closed file is permitted.  Fclose returns null in
30     this case.
31
32 EXAMPLE
33     > fd = fopen("/etc/motd", "r")
34     > if (fd) print "file is open";
35     file is open
36
37     > err = fclose(fd);
38     > if (isnull(err)) print "close successful"; else errno(err);
39     close successful
40
41     > if (!fd) print "file is closed";
42     file is closed
43
44 LIMITS
45     fd != files(0) && fd != files(1) && fd != files(2)
46
47 LINK LIBRARY
48     none
49
50 SEE ALSO
51     errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen,
52     fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt
53