How can I create an in-memory directory in python, like how StringIO
creates in-memory files?
I'm trying to verify the signature of a file using python-gnupg
. I want to create a gnupghome
directory in-memory so that its safe (other non-root processes can't write to it) and ephemeral (gone when I .close()
it or my python app is closed).
The solution needs to be OS-agnostic so it supports linux, Windows, and MacOS (no subprocess
calls to mktemp -d
please).
Is there a native, cross-platform, pythonic way to create a directory in-memory?