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:
parent
673ef11e75
commit
ca8dad5ae7
@ -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()")
|
||||
|
Loading…
Reference in New Issue
Block a user