in reply to Re: Testing if a .txt file contains any data
in thread Testing if a .txt file contains any data

And of course, if you simply wanted to discover as soon as possible that the file is empty, and do not need to retrieve all of the words from it, then you simply try to read something:

if (<LIST> { ... file is not empty ...

Testing the file’s size as reported in its directory-entry is not as satisfactory, I think, because the information in a directory entry is not always up-to-date and accurate.   Whereas, if you actually try to read something and succeed in doing so (assuming that there are no file-access privilege issues), this always tells you what you need to know.

If you do need to grab a list-of-words from the file when it turns out to be nonempty, then the approach that you took would be appropriate.