be more specific if directory can't be written to or doesn't exist

Fixes #897
Merge branch 'dancer-script' into devel