## `fclose` -- close a file

#### Introduction

`fclose(`n`)` closes the file specified by the file descriptor `n`.

#### Call(s)

`fclose(n)`

#### Parameters

`n` | - | a file descriptor returned by `fopen`: a positive integer

#### Returns

the void object of type `DOM_NULL`.

#### Related Functions

`finput`, `fopen`, `fprint`, `fread`, `ftextinput`, `pathname`, `print`, `protocol`, `read`, `READPATH`, `write`, `WRITEPATH`

#### Details

- The file must have been opened with `fopen`. The call to `fopen` yields the file descriptor `n` representing the file.
- Only a limited number of file descriptors is available. The user should use `fclose` to close a file which is no longer needed because this releases the file descriptor. The exact number of file descriptors available depends on the used operating system.
- `fclose` is a function of the system kernel.

#### Example 1

We open a file `test` for writing. This yields the file descriptor `n`:

    >> n := fopen("test", Write)

                                        17

We close the file:

    >> fclose(n): delete n:

#### Changes

- no changes

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000