(Slightly) faster temporary files on Linux

Build status Build status

On "recent" Linux (~2014+), filesystems support a new type of unnamed, persistable temporary file.

The excellent tempfile crate supports two types of temporary files:

It does not, however, expose unnamed (secure, fast), persistable (convenient) files. This crate does.

On non-modern-Linux, this crate falls back to using tempfile's NamedTemporaryFile directly.

"recent" Linux

Support for O_TMPFILE was added to:

Some distros, with release dates, End of Life dates, and kernel versions:

i.e. as of 2017, the latest version, and even the previous version, of everything except CentOS/RHEL looks pretty promising.

Upstreaming

An alternative implementation, ramming this into NamedTemporaryFile, was discussed in a pull-request. This was the result.