hmFS.seek(fileId, position, whence)
Move file pointer
Type
(fileId: number, position: number, whence: number) => void
Parameters
Parameter | Description | Required | Type | Default |
---|---|---|---|---|
fileId | file handle | yes | number | - |
position | Offset based on whence | yes | number | - |
whence | file location | yes | number | - |
Code example
// Open/Create a file.
const fileId = hmFS.open('test_file.txt', hmFS.O_RDWR | hmFS.O_CREAT)
//Locate the file start location.
hmFS.seek(file, 0, hmFS.SEEK_SET)