Skip to content
Snippets Groups Projects
Commit 09fb2b97 authored by Inseo Kim's avatar Inseo Kim
Browse files

File management non printing bug has been fixed

parent 968346ac
No related branches found
No related tags found
1 merge request!7File management non printing bug has been fixed
Pipeline #83465 passed
......@@ -10,4 +10,5 @@ fun main() {
val f = Filemanager("${System.getProperty("user.dir")}/test/", "hello.txt")
f.writefile("hello world")
println(f.openfile())
f.deletefile()
}
hello world
\ No newline at end of file
......@@ -24,6 +24,7 @@ class Filemanager(private val dir: String, private val name: String) {
// create and write to that file
fun writefile(line:String) {
filepath.writeText(line)
listfiles.add(filepath)
}
// opens and read the existing file
......@@ -37,6 +38,7 @@ class Filemanager(private val dir: String, private val name: String) {
}
fun deletefile():Boolean {
listfiles.remove(filepath)
return filepath.delete()
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment