Skip to content

mktemp

mktemp(suffix: string, prefix: string, dir?: string): string

Defined in: packages/pythonlib/src/tempfile.node.ts:37

Generate a unique temporary file path (but don’t create the file).

Note: This is deprecated in Python but still useful in some cases. Consider using mkstemp() or NamedTemporaryFile() instead.

Parameters

ParameterTypeDefault valueDescription
suffixstring""Optional suffix for the filename
prefixstring"tmp"Optional prefix for the filename (default: “tmp”)
dir?stringundefinedOptional directory (default: system temp dir)

Returns

string

Path to the temporary file