The end of a file is reached if:
file_str_read, file_str_readto return -1
or if
file_var_read returns 0 (this seems a bit odd, as you should be able to store zeros in a file)

Information is taken from: the manual

Sorry if I did not understand your question.