# FileDir - script function

The FileDir function returns a string containing the path to the directory of the table file currently being read.

Syntax:

FileDir()

Examples and results:

Examples and results

| Example | Result |
| --- | --- |
| `Load *, filedir(<br>) as X from`<br>`C:\UserFiles\abc.txt` | Will return<br>'C:\UserFiles' in field X in each record read. |