Every directory will contain at least two files; . and ... So you'd open the directory, count the number of files in it, and then see if there are more than two. The [man]filesystem[/man] and [man]dir[/man] functions will be what you want to use: [man]file_exists[/man], [man]is_dir[/man], [man]scandir[/man].