Directory validity check.