tempfile: add several functions for creating temporary files