tell

tell — indicates file position.

Syntax

tell (file)

		

Arguments

file

A file pointer to a previously opened file. This may be either a file in the file system, or a string opened for read and write.

Returns

Current file position, as an integer.

Description

This function returns the current file position as an integer representing the number of characters from the beginning of the file.

Example

Gamma> msk = open("myseekfile.dat", "r",nil);
#<File:"myseekfile.dat">
Gamma> read_until(msk,"f");
"Now is the time "
Gamma> tell(msk);
17
Gamma> seek(msk, 18, 1);
t
Gamma> tell(msk);
35
Gamma> msk = open("myseekfile3.dat", "w",nil);
#<File:"myseekfile3.dat">
Gamma> write(msk,"hello");
t
Gamma> tell(msk);
7
Gamma> msk = open("myseekfile3.dat", "a",nil);
#<File:"myseekfile3.dat">
Gamma> write(msk,"goodbye");
t
Gamma> tell(msk);
16
Gamma> 
		

See Also

open, open_string, read, read_char, read_double, read_float, read_line, read_long, read_short, read_until, seek