Skip to content

Instantly share code, notes, and snippets.

@koral--
Created September 25, 2017 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koral--/e0b5b7a0b6aeba46d2310d31340fe5cf to your computer and use it in GitHub Desktop.
Save koral--/e0b5b7a0b6aeba46d2310d31340fe5cf to your computer and use it in GitHub Desktop.
readAfterDeletion created by koral - https://repl.it/L91G/0
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()}")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment