The [file->marker] method returns the location of the current marker within the file. The marker determines where in the file data will be written or read and can be set using [file->setMarker].
local(f) = file(...)
#f->marker
The code below reads a byte at a time from a file until the marker reaches 15 and then stops.
Code
local(my_file) = file('/rhino/test.txt')
handle => { #my_file->close }
#my_file->openRead
while(true) => {^
if(#my_file->marker > 14) => {^
loop_abort
^}
#my_file->readSomeBytes(1)
^}
Result
"Great Scott!"
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Recent Comments