We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6fb394 commit 828fc1fCopy full SHA for 828fc1f
src/posixMain/kotlin/File.kt
@@ -13,14 +13,14 @@ actual class File actual constructor(private val rawPath: String) {
13
actual val isDirectory: Boolean get() = isMode(S_IFDIR)
14
actual val isRoot: Boolean = path == SLASH
15
16
- @OptIn(ExperimentalForeignApi::class)
+ @OptIn(ExperimentalForeignApi::class, UnsafeNumber::class)
17
private fun isMode(modeBits: Int): Boolean {
18
- val statResult = memScoped {
+ val statMode = memScoped {
19
val statResult = alloc<stat>()
20
stat(path, statResult.ptr)
21
- statResult
+ statResult.st_mode.toInt()
22
}
23
- return (statResult.st_mode.toInt() and modeBits) != 0
+ return (statMode and modeBits) != 0
24
25
26
@OptIn(ExperimentalForeignApi::class)
0 commit comments