---
title: "getFilePath"
canonical: "https://help.vicon.com/space/ShogunPost121/1253737559/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/ShogunPost121/pages/1253738450) command.

## Functional area

Disk I/O

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `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/ShogunPost121/pages/1253736768)
- [fileOpen](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738450)