Hi, seems like File(parent, child) is not working properly if we use \ as file separator.
For example, if I use System.getenv("AppData"), I will get this as a result: C:\Users\Bojan\AppData\Roaming
If I then do this
val directory = System.getenv("AppData")
val file = "myFile.txt"
val merged = File(directory, file)
println("Merged is: ${merged.path}")
My output will be "C:\Users\Bojan\AppData\RoamingMyFile.txt".
Expected output file should be "C:\Users\Bojan\AppData\Roaming\MyFile.txt".
Hi, seems like File(parent, child) is not working properly if we use
\
as file separator. For example, if I useSystem.getenv("AppData")
, I will get this as a result:C:\Users\Bojan\AppData\Roaming
If I then do thisMy output will be
"C:\Users\Bojan\AppData\RoamingMyFile.txt"
. Expected output file should be"C:\Users\Bojan\AppData\Roaming\MyFile.txt"
.