Skip to content
Snippets Groups Projects
Commit 1d676682 authored by Abhay Menon's avatar Abhay Menon
Browse files

Merge branch 'File-management-for-console-app' into 'main'

File management error has been fixed

See merge request !6
parents e8de16a1 968346ac
No related branches found
No related tags found
1 merge request!6File management error has been fixed
Pipeline #83385 passed
......@@ -9,5 +9,5 @@ fun main() {
// thesea re test functions feel free to use
val f = Filemanager("${System.getProperty("user.dir")}/test/", "hello.txt")
f.writefile("hello world")
println(f.openfile())
println(f.openfile())
}
......@@ -28,7 +28,7 @@ class Filemanager(private val dir: String, private val name: String) {
// opens and read the existing file
fun openfile(): String {
if (listfiles.contains(filepath)) {
if (!listfiles.contains(filepath)) {
return ""
}
val inputStream: InputStream = filepath.inputStream()
......
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