I discovered this #128 workaround doesn't always work on Apple platforms. The result from mktemp() is often not an empty string, but rather 1 or 2 bytes of seemingly junk, non-character data. This is running on macOS 13.4.1 with targets macosX64, iosX64, tvosX64, and watchosX64. The workaround sometimes works for macOS and iOS targets, but tvOS and watchOS seem to never get an empty string result to trigger the workaround.
Also, "$tmpDir/tmp-${rnd.nextInt()}" puts a double // in the path: ...//tmp-....