Fixes #9518 - "file state=directory" silently skips if it's currently a file
Merge pull request #505 from sysadmin75/9518

Fixes #9518 - "file state=directory" silently skips if it's currently a ...