---
title: "fileSeek"
canonical: "https://support.appfire.com/space/PSJ/15488455/fileSeek"
format: markdown
---
> Macro (aura-html)


|  |  |  |  |
| --- | --- | --- | --- |
| **Syntax** | fileSeek(fid, pos) | **Package** | file |
| **Alias** |  | **Pkg Usage** | seek(fid, pos) |

## Description

> Macro (excerpt)
> 
> Moves the file pointer to a specific spot in an already open file. If the position is negative, moves the file pointer at the end of the file. If the position is 0 (zero) it moves the pointer at the beginning of the file.

Moves the file pointer to a specific spot in an already open file.

## Parameters

| Parameter name | Type | Required | Description |
| --- | --- | --- | --- |
| fid | String | Yes | The id of the open file to read from. |
| pos | Integer | Yes | The new position of the cursor. |

## Return Type

**Integer**

Returns the current position of the file pointer.

## Error Handling

Throws **String**


 Error: "seek_error": followed by the actual error
 


## Example

### Example 1

```javascript
use "file";
int fid = open("C:\alphabet.txt");
seek(fid, 10);
runnerLog(fileReadLine(fid));
close(fid);
```

Returns: KLMNOPQRSTUVWXYZ

## See also

> Macro (contentbylabel)