1
0
mirror of https://github.com/mamoe/mirai.git synced 2025-04-09 02:10:10 +08:00

Use read mode rb and wb for MiraiFile on Linux and macOS

This commit is contained in:
Him188 2022-06-07 20:24:52 +01:00
parent 673ef11e75
commit ca8dad5ae7
No known key found for this signature in database
GPG Key ID: BA439CDDCF652375

View File

@ -154,7 +154,7 @@ internal actual class MiraiFileImpl actual constructor(
}
override fun input(): Input {
val handle = fopen(absolutePath, "r")
val handle = fopen(absolutePath, "rb")
?: throw IOException(
"Failed to open file '$absolutePath'",
PosixException.forErrno(posixFunctionName = "fopen()")
@ -163,7 +163,7 @@ internal actual class MiraiFileImpl actual constructor(
}
override fun output(): Output {
val handle = fopen(absolutePath, "w")
val handle = fopen(absolutePath, "wb")
?: throw IOException(
"Failed to open file '$absolutePath'",
PosixException.forErrno(posixFunctionName = "fopen()")