Don't yield directories if they are not gonna be used.