Something like "DirectoryHasChildren" that would
signal "This directory contains files and cannot be deleted.".

+1

The only problem may be that even the VM doesn't actually know the reason (it could just trigger the delete at vm-level which will just return a failure state).

Peter