Make directory creation conditional on directory attribute being set