Java.IO.File.CreateTempFile Method
Creates an empty temporary file in the given directory using the given prefix and suffix as part of the file name.

Syntax

[Android.Runtime.Register("createTempFile", "(Ljava/lang/String;Ljava/lang/String;Ljava/io/File;)Ljava/io/File;", "")]
public static File CreateTempFile (string prefix, string suffix, File directory)

Parameters

prefix
the prefix to the temp file name.
suffix
the suffix to the temp file name.
directory
the location to which the temp file is to be written, or null for the default location for temporary files, which is taken from the "java.io.tmpdir" system property. It may be necessary to set this property to an existing, writable directory for this method to work properly.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Lang.IllegalArgumentExceptionif the length of prefix is less than 3.
Java.IO.IOExceptionif an error occurs when writing the file.

Remarks

Creates an empty temporary file in the given directory using the given prefix and suffix as part of the file name. If suffix is null, .tmp is used.

Note that this method does not call File.DeleteOnExit, but see the documentation for that method before you call it manually.

[Android Documentation]

Requirements

Namespace: Java.IO
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1