.. highlightlang:: us .. _fseek: fseek ===== .. index:: fseek .. us.tag fseek ENGLISH ffiles Changed530 :ref:`fseek` moves the file pointer to a new position. .. function:: bool = fseek(fh) bool = fseek(fh, nSeek) bool = fseek(fh, nSeek, nOrigin) .. us.return **Return Value** If the function succeeds, the return value is TRUE (1); otherwise it is FALSE (0). .. us.params **Parameters** .. uparam:: fh Identifies the file. .. uparam:: nSeek *nSeek* is the number of bytes from *nOrigin*. .. uparam:: nOrigin *nOrigin* is one of the following values: .. list-table:: :header-rows: 1 * - Value - Meaning * - SEEK_CUR (1) - Current position of file pointer. * - SEEK_END (2) - End of the file. * - SEEK_SET (0) - Beginning of file (default value). .. us.example **Example** :: fh = fopen("c:/test.bin", "w+"); // write 100 short values fwrite(fh, "int16", 1:100); print fseek(fh, -100, SEEK_CUR); // read 50 short values rvValues = fread(fh, "int16", 50); fclose(fh); print rvValues'; .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - 5.3.0 - *nSeek* can be larger than 32 bit. .. seealso:: :ref:`overview-binary-and-text-files`, :ref:`fopen`, :ref:`ftell` :sub:`id-625630`