check if output is a dir.