Click or drag to resize

FTell64 Function

X#
Return the current position of the file pointer.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax
 FUNCTION FTell64(
	pFile AS IntPtr
) AS INT64
Request Example View Source

Parameters

pFile
Type: IntPtr

Return Value

Type: Int64
The current position of the file pointer, relative to the beginning of the file.
Remarks
FTell() gets the current file position.
This corresponds to the current physical byte offset for files opened in binary mode.
Examples
This example uses FTell() to reflect the file pointer position before and after an FWrite() and an FSeek():
X#
 1hF := FOpen2("myfile.txt", FO_READWRITE)
 2IF hF != F_ERROR
 3    ? FTell(hF)                //  0
 4    FWrite3(hF, "Hello", 5)
 5    ? FTell(hF)                //  5
 6    FSeek3(hF, 10, FS_SET)
 7    ? FTell(hF)                //  10
 8ELSE
 9    ? "Open failed"
10ENDIF
See Also