tuweni / org.apache.tuweni.io.file / Files / createFileIfMissing

createFileIfMissing

static fun createFileIfMissing(path: Path, vararg attrs: FileAttribute<*>): Boolean (source)

Create a file, if it does not already exist.

Parameters

path - The path to the file to create.

attrs - An optional list of file attributes to set atomically when creating the file.

Exceptions

IOException - If an I/O error occurs or the parent directory does not exist.

Return
true if the file was created.