openReadWrite

expect abstract fun openReadWrite(file: Path, mustCreate: Boolean = false, mustExist: Boolean = false): FileHandle

Returns a handle to read and write file. This will create the file if it doesn't already exist.

Parameters

mustCreate

true to throw an IOException instead of overwriting an existing file. This is equivalent to O_EXCL on POSIX and CREATE_NEW on Windows.

mustExist

true to throw an IOException instead of creating a new file. This is equivalent to r+ on POSIX and OPEN_EXISTING on Windows.

Throws

if file is not a file, or cannot be accessed. A file cannot be accessed if the current process doesn't have sufficient reading and writing permissions for file, if there's a loop of symbolic links, or if any name is too long.

actual abstract fun openReadWrite(file: Path, mustCreate: Boolean, mustExist: Boolean): FileHandle
fun openReadWrite(file: Path): FileHandle
actual abstract fun openReadWrite(file: Path, mustCreate: Boolean, mustExist: Boolean): FileHandle
actual abstract fun openReadWrite(file: Path, mustCreate: Boolean, mustExist: Boolean): FileHandle
actual abstract fun openReadWrite(file: Path, mustCreate: Boolean, mustExist: Boolean): FileHandle