skolson / KmpIO

Kotlin multi-platform simple File I/O library
Other
32 stars 2 forks source link

File(parent, child) not working properly if path uses "\" as file separator #10

Open bnovakovic opened 4 weeks ago

bnovakovic commented 4 weeks ago

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".

skolson commented 2 weeks ago

Found this, fix will be in release 0.1.8 coming soon - still trying to resolve issue #9