File.CreateTempFile File.CreateTempFile Method

Definition

Overloads

CreateTempFile(String, String) CreateTempFile(String, String)

Creates an empty temporary file using the given prefix and suffix as part of the file name.

CreateTempFile(String, String, File) CreateTempFile(String, String, File)

Creates an empty temporary file in the given directory using the given prefix and suffix as part of the file name.

CreateTempFile(String, String) CreateTempFile(String, String)

Creates an empty temporary file using the given prefix and suffix as part of the file name.

[Android.Runtime.Register("createTempFile", "(Ljava/lang/String;Ljava/lang/String;)Ljava/io/File;", "")]
public static Java.IO.File CreateTempFile (string prefix, string suffix);
static member CreateTempFile : string * string -> Java.IO.File

Parameters

prefix
String String

the prefix to the temp file name.

suffix
String String

the suffix to the temp file name.

Returns

Exceptions

if an error occurs when writing the file.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

CreateTempFile(String, String, File) CreateTempFile(String, String, File)

Creates an empty temporary file in the given directory using the given prefix and suffix as part of the file name.

[Android.Runtime.Register("createTempFile", "(Ljava/lang/String;Ljava/lang/String;Ljava/io/File;)Ljava/io/File;", "")]
public static Java.IO.File CreateTempFile (string prefix, string suffix, Java.IO.File directory);
static member CreateTempFile : string * string * Java.IO.File -> Java.IO.File

Parameters

prefix
String String

the prefix to the temp file name.

suffix
String String

the suffix to the temp file name.

directory
File File

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

Exceptions

if the length of prefix is less than 3.

if an error occurs when writing the file.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to