create

fun File.create(createFileOrDir: Boolean = false, asDirectory: Boolean = false)

All parent directories are created, but not the file itself.

createFileOrDir in combination with asDirectory will result in this file being treated as a directory. As such, all parents will be created, along with this file itself being created as a directory.

createFileOrDir without asDirectory will result in this file being created as a file.

Author

Griefed

Parameters

createFileOrDir

Whether the file or directory should be created. If left to false, then asDirectory won't have any effect.

asDirectory

true to create a directory, false to create a file. Requires createFileOrDir to be true