Udostępnij za pośrednictwem


Files.CreateFile(IPath, IFileAttribute[]) Method

Definition

Creates a new and empty file, failing if the file already exists.

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

Parameters

path
IPath

the path to the file to create

attrs
IFileAttribute[]

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

Returns

the file

Attributes

Remarks

Java documentation for java.nio.file.Files.createFile(java.nio.file.Path, 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