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

Use this command to determine whether you are at the end of a file. This is useful when you are reading in a file and want to know if you have finished reading all the contents or gotten to the end.

readXXXX commands performed when at the end of a file will fail, causing your script to fail, so it is good practice to call this command often when reading a file.

## Functional area

Disk I/O

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `isEndOfFile fileID` |

### Arguments

| Name | Type | Required | Comments |
| --- | --- | --- | --- |
| `fileID` | int |  | ID of file previously opened with [fileOpen](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738450) |

### Flags

None

## Return value

boolean

> Macro (scroll-pagebreak)

## Examples

```plaintext
int $fileID;
// Obtain file ID earlier do some operation to the file
// ...
while( `isEndOfFile` == false )
   { 
   // Read in something
}
```

# Additional information

## Related commands

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