okio icon indicating copy to clipboard operation
okio copied to clipboard

Issue with folders named like 'X: Something'

Open Ribesg opened this issue 1 year ago • 1 comments

Okio behaves weirdly with folders named like X: Something on at least MacOS Arm64 and Linux X64.

You can easily reproduce the issue in a Gradle project with native targets:

fun main() {
    FileSystem.SYSTEM.run {
        createDirectories("build/tmp/Working Folder".toPath())
        createDirectories("build/tmp/X: Broken Folder".toPath())
        list("build/tmp".toPath()).forEach(::println)
    }
}
tmp$ ./gradlew clean runDebugExecutableMacosArm64

> Task :runDebugExecutableMacosArm64
X: Broken Folder
build/tmp/Working Folder

BUILD SUCCESSFUL in 3s
10 actionable tasks: 6 executed, 4 up-to-date

Ribesg avatar Mar 23 '24 16:03 Ribesg

Oooh thanks for reporting this. I made a design decision to make path processing platform-independent, which is what’s causing grief here.

We’re incorrectly interpreting this as a Windows drive letter followed by a path name, rather than a single path name where the 2nd character is a colon. Ugh.

I’ll see what we can do to fix!

swankjesse avatar Mar 23 '24 18:03 swankjesse