swift-nio
swift-nio copied to clipboard
NIOFileSystem.temporaryDirectory: Consider falling back to TMPDIR
https://github.com/apple/swift-nio/blob/30df8551f4e636b8f68627dbc205221bcfc57782/Sources/NIOFileSystem/FileSystem.swift#L638
Currently, NIOFS's temporaryDirectory
uses _CS_DARWIN_USER_TEMP_DIR
on Darwin and /tmp
//data/local/tmp
anywhere else. I think we should consider the env var TMPDIR
if set.
So maybe:
- Darwin:
_CS_DARWIN_USER_TEMP_DIR
->TMPDIR
->/tmp
- Linux:
TMPDIR
->/tmp
- Android:
TMPDIR
->/data/local/tmp
?