Difference between revisions of "FSEEK()"

From Recital Documentation Wiki
Jump to: navigation, search
 
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
==Class==
 
ASCII File Access
 
 
 
 
==Purpose==
 
==Purpose==
 
Function to position to a byte offset within a text file
 
Function to position to a byte offset within a text file
Line 43: Line 39:
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]

Latest revision as of 16:00, 2 December 2009

Purpose

Function to position to a byte offset within a text file


Syntax

FSEEK(<expN1>, <expN2>, <expN3>)


See Also

FCLOSE(), FCREATE(), FERROR(), FGETS(), FREAD(), FREADSTR(), FWRITE()


Description

The FSEEK() function is used to position to a byte offset within a text file. The <expN1> is a valid file handle returned from the FOPEN() function. The <expN2> is the byte offset position to move the file pointer based on value defined by <expN3>. This can be a positive or negative number depending on the direction of pointer movement. The <expN3> defines the positions from which to start the byte offset, and can be any of the following three options:


Offset Description
0 Start from start of file
1 Start from current position
2 Start from EOF


FSEEK() returns the new position of the file pointer relative to the beginning of the file. The beginning of the file is 0 regardless of the direction of movement.


Example

fp = fopen("names.txt")
string = fgets(fp)
fseek(fp, 1024,0)


Products

Recital Server, Recital