githubEdit

CreateTempFile

Creates a temporary file in the specified directory with the specified prefix and suffix if passed.

Method Signature

CreateTempFile(directory=[string], prefix=[string], suffix=[string])

Arguments

Argument
Type
Required
Description
Default

directory

string

false

The directory in which to create the temp file, we default to the system temp directory

/var/folders/qr/xsqq4bd544x8qdm9s8ngwtdh0000gn/T/

prefix

string

false

The prefix string to be used in generating the file's name; may be empty

suffix

string

false

The suffix string to be used in generating the file's name; may be empty, in which case ".tmp" is used

Examples

Create temp file in temp dir

Returns path of file created

Run Examplearrow-up-right

getTempFile( getTempDirectory(), "testFile" );

Result: /private/var/folders/k6/hm9skhxj2dd_901z2f2mkwt00000gn/T/testFile13427324567646329113.tmp

Additional Examples

Run Examplearrow-up-right

Last updated

Was this helpful?