swift-nio icon indicating copy to clipboard operation
swift-nio copied to clipboard

NIOFileSystem.temporaryDirectory: Consider falling back to TMPDIR

Open weissi opened this issue 5 months ago • 5 comments

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 ?

weissi avatar Sep 03 '24 09:09 weissi