Skip to content

Commit a674cf4

Browse files
committed
Update filePathSeparator for Windows
1 parent d0dc45d commit a674cf4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/util/PlatformNative.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ internal actual object SystemDefaultProvider : PlatformProvider {
2525
actual override fun getenv(key: String): String? = platform.posix.getenv(key)?.toKString()
2626

2727
actual override val filePathSeparator: String
28-
get() = "/" // Unix-style separator is used in Native
28+
get() = when (osInfo().family) {
29+
OsFamily.Windows -> "\\"
30+
else -> "/"
31+
}
2932

3033
actual override suspend fun readFileOrNull(path: String): ByteArray? {
3134
return try {

0 commit comments

Comments
 (0)