---
title: "fileClose"
canonical: "https://support.appfire.com/space/PSCONF/15305519/fileClose"
format: markdown
---
> Macro (aura-html)

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | fileClose(fid) | **Package** | file |
> | **Alias** |  | **Pkg Usage** | close(fid) |

## Description

> Macro (excerpt)
> 
> Closes a previously opened file and removes it from memory.

Closes a previously opened file and removes it from memory.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | file id | Integer | Yes | The id of a file opened from a previous step that should be closed. |

## Return Type

**None**

Return value has no meaning.

## Error Handling

Throws **String**

**Errors:**

- "invalid": if the path is invalid
- "cannot_work_on_directory": if the path is a directory, in fact, and not a file
- "unresolvable": if the file cannot be resolved
- "notfound": if the file is not found

## Example

### Example 1

```javascript
use "file";
int fid = open(filename); //fileOpen
fileClose(fid);//full name of the routine
```

## See also

> Macro (contentbylabel)