# FS_SeekFile

## Syntax

  `#include <nitro/fs.h>`
  `BOOL FS_SeekFile( FSFile *p_file, s32 offset, FSSeekMode origin );`

## Arguments

p_file | Address of the `FSFile` structure.
offset | Number of bytes to move (in a positive direction from the beginning toward the end).
origin | Base position of the move.

## Return Values

`TRUE` if the file pointer is correctly moved; `FALSE` otherwise.

## Description

Moves the file pointer from a base point that is specified by origin to a position that is offset by the amount that is specified by offset. The origin type is defined by the `FSSeekFileMode` type.

Note: If the new specified position is beyond the beginning or the end of the file, the NITRO-SDK and TWL-SDK yield different results.

NITRO-SDK | The file pointer is corrected to fall in the bounds of the file.
TWL-SDK | The function fails and returns `FALSE`, and the `FS_GetResultCode` function returns `FS_RESULT_INVALID_PARAMETER`.

## See Also

`FSFile`
`FSSeekFileMode`
`FS_GetFileLength`
`FS_ReadFile`
`FS_SeekFileToBegin`
`FS_SeekFileToEnd`

## Revision History

2009/07/29 Added mention that behavior differs for the NITRO-SDK and TWL-SDK when the file pointer is moved out of range.
2008/10/02 Updated part of See Also.
2004/04/01 Initial version.

CONFIDENTIAL