> @myronmarston $TMPDIR appears to be the correct solution here, do you agree?

If that's a posix standard, sure.  I wasn't aware that it was.  See my comment above about the fact that it should be OK to put it in a subdirectory.

That said, do what works, so if $TMPDIR works, great.