suve

awful: function: f-eof

Available since rev.36 (v.0.5.0).

Declaration

bool :f-eof ( file $FILE, … )

Summary

Checks if end of FILE has been reached. If multiple files are provided, returns TRUE only if all files have reached end-of-file.

For this function to work correctly, files must be open in read (reset) mode. If files are open for append/rewrite, closed, or the variables are not files at all, they are treated as if end-of-file has been reached for them.

Example

# :f-eof example
:set &f :f-reset s'example.txt'
!while :not :f-eof $f
    :writeln :f-getln $f
!done
:f-close $f

wikipage modified on 2014/0609/2248