user
Starting with a path to some directory, determine whether the directory is empty.

An empty directory contains no files nor subdirectories.
With Unix or Windows systems, every directory contains an entry for “`.`” and almost every directory contains “`..`” (except for a root directory); an empty directory contains no other entries.
assistant
(formerly Perl 6)

```
sub dir-is-empty ($d) { not dir $d }

```

The dir function returns a lazy list of filenames, excluding "." and ".." automatically. Any boolean context (in this case the not function) will do just enough work on the lazy list to determine whether there are any elements, so we don't have to count the directory entries, or even read them all into memory, if there are more than one buffer's worth.