Language

Files.CreateTempDirectory Method

Definition

Overloads

Name Description
CreateTempDirectory(String, IFileAttribute[])

Creates a new directory in the default temporary-file directory, using the given prefix to generate its name.

CreateTempDirectory(IPath, String, IFileAttribute[])

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

CreateTempDirectory(String, IFileAttribute[])

Creates a new directory in the default temporary-file directory, using the given prefix to generate its name.

[Android.Runtime.Register("createTempDirectory", "(Ljava/lang/String;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/file/Path;", "", ApiSince=26)]
public static Java.Nio.FileNio.IPath? CreateTempDirectory(string? prefix, params Java.Nio.FileNio.Attributes.IFileAttribute[]? attrs);
[<Android.Runtime.Register("createTempDirectory", "(Ljava/lang/String;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/file/Path;", "", ApiSince=26)>]
static member CreateTempDirectory : string * Java.Nio.FileNio.Attributes.IFileAttribute[] -> Java.Nio.FileNio.IPath

Parameters

prefix
String

the prefix string to be used in generating the directory's name; may be null

attrs
IFileAttribute[]

an optional list of file attributes to set atomically when creating the directory

Returns

the path to the newly created directory that did not exist before this method was invoked

Attributes

Remarks

Java documentation for java.nio.file.Files.createTempDirectory(java.lang.String, java.nio.file.attribute.FileAttribute).

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

CreateTempDirectory(IPath, String, IFileAttribute[])

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

[Android.Runtime.Register("createTempDirectory", "(Ljava/nio/file/Path;Ljava/lang/String;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/file/Path;", "", ApiSince=26)]
public static Java.Nio.FileNio.IPath? CreateTempDirectory(Java.Nio.FileNio.IPath? dir, string? prefix, params Java.Nio.FileNio.Attributes.IFileAttribute[]? attrs);
[<Android.Runtime.Register("createTempDirectory", "(Ljava/nio/file/Path;Ljava/lang/String;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/file/Path;", "", ApiSince=26)>]
static member CreateTempDirectory : Java.Nio.FileNio.IPath * string * Java.Nio.FileNio.Attributes.IFileAttribute[] -> Java.Nio.FileNio.IPath

Parameters

dir
IPath

the path to directory in which to create the directory

prefix
String

the prefix string to be used in generating the directory's name; may be null

attrs
IFileAttribute[]

an optional list of file attributes to set atomically when creating the directory

Returns

the path to the newly created directory that did not exist before this method was invoked

Attributes

Exceptions

if the prefix cannot be used to generate a candidate directory name

if the array contains an attribute that cannot be set atomically when creating the directory

if an I/O error occurs or dir does not exist

In the case of the default provider, and a security manager is installed, the checkWrite method is invoked to check write access when creating the directory.

Remarks

Java documentation for java.nio.file.Files.createTempDirectory(java.nio.file.Path, java.lang.String, java.nio.file.attribute.FileAttribute<?>...).

Java reference for java.nio.file.Files.createTempDirectory.

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