---
title: "fileClose"
canonical: "https://help.vicon.com/space/ShogunPost121/1253736768/fileClose"
format: markdown
---
# Description

Use this command to close a file that you have opened using the [fileOpen](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738450) command, after you are done reading from/writing to the file.

Note that many write operations won't get actually written until the file is closed. You should always close your files as loose files can squander your system resources. You may also not see the result of any writeXXXX commands until you close your file. Also, permissions may prevent you from subsequently opening the file.

## Functional area

Disk I/O

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `fileClose fileID` |

### Arguments

| Name | Type | Required | Comments |
| --- | --- | --- | --- |
| `fileID` | int |  | ID of file previously opened with fileOpen |

### Flags

None

## Return value

void 

> Macro (scroll-pagebreak)

## Examples

```plaintext
int $fileID;
// Obtain file ID earlier do some operation to the file
// ...
// Close the file
fileClose $fileID;
```

# Additional information

## Related commands

- [fileOpen](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738450)