Nasal library/io: Difference between revisions

Jump to navigation Jump to search
→‎Functions: Doc tell()
(→‎Functions: Doc tell())
Line 335: Line 335:


=== tell(filehandle) ===
=== tell(filehandle) ===
Returns the current seek position of the filehandle.
{{Nasal doc
|syntax = io.tell(file);
|text = Returns the current pointer position of the file.
|param1 = file
|param1text = File object as returned by {{func link|open}}.
|example1 = var path = getprop("/sim/fg-root") ~ '/Nasal/geo.nas';
var file = io.open(path);
io.seek(file, 2, io.SEEK_SET);
print(io.tell(file)); # prints "2"
io.close(file);
}}


=== write(filehandle, str) ===
=== write(filehandle, str) ===

Navigation menu