You don't need a UDF.

Enumerate the directory using DIR(), then use GetFileSize() on any files that you find.

If the file size is zero then the file is empty.