Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!

Idiom #138 Create temp file

Create a new temporary file on the filesystem.

#include <stdlib.h>
const char tmpl[] = "XXXXXX.tmp";
int fd = mkstemp(tmpl);

Template must contain six X characters that will be modified by mkstemp

New implementation...
< >
programming-idioms.org