fileTell
fileTell(p_port) =>x_offset
Description
Returns the current offset in bytes for the file opened on a port.
Arguments
Value Returned
|
Current offset (from the beginning of the file) in bytes for the file opened on p_port. |
Examples
Let the file test.data contain the single line of text:
0123456789 test xyz
p = infile("test.data")
=> port:"test.data"
fileTell(p)
=> 0
for(i 1 10 getc(p))
=> t ; Skip first 10 characters
fileTell(p)
=> 10
fscanf(p "%s" s)
=> 1 ;s = "test" now
fileTell(p)
=> 15
Related Topics
Return to top