repl.it
@koral/

readAfterDeletion

Kotlin (beta)

No description

fork
loading
main.kt
1
2
3
4
5
6
7
8
9
10
11
import java.io.BufferedReader
import java.io.File
import java.io.FileReader

val file = File("test")
file.writeText("this is file content")

BufferedReader(FileReader(file)).use {
   println("deleted?: ${file.delete()}")
   println("content?: ${it.readLine()}")
}
Welcome to Kotlin version 1.0.3