I eventually realised `withTempFile` (& cetera) was just too painful to use and ended up with `withTempDirectory` instead.