tempfile-fast

Crates.iotempfile-fast
lib.rstempfile-fast
version0.3.4
sourcesrc
created_at2017-08-01 16:48:21.934201
updated_at2021-08-29 11:44:53.430283
descriptionSupport for Linux-specific tempfile extensions
homepage
repositoryhttps://github.com/FauxFaux/tempfile-fast-rs
max_upload_size
id25993
size26,283
Chris West (FauxFaux)

documentation

README

(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:

  • unnamed temporary files, which are secure and fast, but which can never be written into real the filesystem.
  • named temporary files, which have some theoretical security risks and performance problems, but you must use if you ever want to write the data into the real filesystem efficiently.

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:

  • Linux 3.11: ext2, ext3, ext4, UDF, Minix, shmem.
  • Linux 3.15: xfs
  • Linux 3.16: btrfs, f2fs
  • Linux 4.9: ubifs

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

  • Ubuntu 12.04 (Apr 2012 - Apr 2017): 3.2
  • Debian Wheezy (May 2013 - May 2018): 3.2
  • Ubuntu 14.04.0 (Apr 2014 - Apr 2019): 3.13
  • RHEL 7 (Jun 2014 - Jun 2024): 3.10
  • Debian Jessie (Apr 2015 - Apr 2020): 3.16
  • OpenSUSE Leap 42.1 (Nov 2015 - May 2017): 4.1
  • Ubuntu 14.04.5 (Aug 2016 - Apr 2019): 4.4
  • Debian Stretch (Jun 2017 - ): 4.9

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.

Commit count: 61

cargo fmt