tempdir: error on non-directory result (#33593)
Potential more graceful handling of
https://github.com/JuliaLang/julia/issues/33382. I thought about
creating the directory if it doesn't exist, but that seems aa bit
questionable. Probably better to let the user know about the situation
in a clear way so they can mitigate it. An even better improvement would
be if we could tell them which environment variable to look at. I tried
setting `TEMP` in the environment on macOS but it didn't seem to have
any effect on the result.
---------
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
Co-authored-by: Dilum Aluthge <dilum@aluthge.com>