How to check whether a .txt file is empty

FileByteCount will give 0 for empty text files and is very fast (0.00003 seconds per file on my machine).

FileByteCount["~/test.txt"]

FileByteCount will probably be the fastest way of checking strict emptiness. But what if you need to actually read the file (e.g. check integrity or catch some corner case)? Here's an alternative where the file content is checked, using Read. In general, streams are the fastest way to read and write data in external files.

Generate your file list

filelist=FileNames["path/to/directory/*.txt"]

Read the first word (Word)/number (Number) of the file. If the file is empty, it should return the symbol EndOfFile.

Map[Read[#, Word] &][filelist]

This gives you the option to run some test on the contents of the first lines of the file. Don't forget to close the opened streams so that you don't read subsequent lines if you repeat the command.

Map[Close][filelist]

The only thing that is not cross-platform is the way the path to the working directory is written!