[PD] Testing whether a directory is empty without printing error messages if it is