createTempFile

fun createTempFile(
    prefix: String = "tmp",
    suffix: String? = null,
    directory: File? = null
): File
(source)

Platform and version requirements: JVM

Creates a new empty file in the specified directory, using the given prefix and suffix to generate its name.

If prefix is not specified then some unspecified name will be used. If suffix is not specified then ".tmp" will be used. If directory is not specified then the default temporary-file directory will be used.

Exceptions

IOException - in case of input/output error.

IllegalArgumentException - if prefix is shorter than three symbols.

Return a file object corresponding to a newly-created file.