At times we need to check if a folder is empty or not before performing an operation on it. For this, I have written a function which returns TRUE if any file or folder is found inside the folder and FALSE if the folder is empty.
Your function is not bad either but why you continue reading all the files and folder if you found a file or folder in it. Just check as if a file found and terminate the loop with break.