---
title: "getFilePath"
canonical: "https://help.vicon.com/space/Shogun17/13536399/getFilePath"
format: markdown
---
# Description

Returns the path of a file pointed to by the given file handle.

The file handle is one returned by the [fileOpen](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13536511) command.

## Functional area

Disk I/O

# Command syntax

## Syntax

|  |
| --- |
| `getFilePath fileID` |

### Arguments

| **Name** | **Type** | **Required** | **Comments** |
| --- | --- | --- | --- |
| `fileID` | integer | yes | The fileID is usually a variable created earlier in the script with the fileOpen command |

### Flags

None

## Return value

string

Returns the full path to the file pointed to by the given file handle. 

> Macro (scroll-pagebreak)

## Examples

```plaintext
// Create a temp file query the file path and 
// print it to the command log
// This creates the file c:/temp/temp.txt and returns the handle to us.
int $fileID = `fileOpen "c:/temp/temp.txt" "w"`;
string $filePath = `getFilePath $fileID`;
 
// Be sure to close the file.
fileClose $fileID;
 
// Now print out the file path
print $filePath;
```

# Additional information

## Related commands

- [fileClose](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13536513)
- [fileOpen](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13536511)