Skip to content

Commit 411ac39

Browse files
authored
Merge pull request #10 from Archinamon/six_no_such_file_exception
added path to nosuchfile exception
2 parents 6fcd8ad + 62c0bf7 commit 411ac39

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
}
77

88
group = "me.archinamon"
9-
version = "1.3.8"
9+
version = "1.3.9"
1010

1111
val isRunningInIde: Boolean = System.getProperty("idea.active")
1212
?.toBoolean() == true

src/posixMain/kotlin/File.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ actual class File actual constructor(
231231

232232
internal fun writeBytes(bytes: ByteArray, mode: Int, size: ULong = ULong.MAX_VALUE, elemSize: ULong = 1U) {
233233
if (!exists()) {
234-
throw NoSuchElementException("File or directory not exists")
234+
throw NoSuchElementException("File or directory '${getAbsolutePath()}' not exists")
235235
}
236236

237237
val fd = fopen(getAbsolutePath(), if (mode and O_APPEND == O_APPEND) modeAppend else modeRewrite)
@@ -284,7 +284,7 @@ actual val File.mimeType: String
284284

285285
actual fun File.readBytes(): ByteArray {
286286
if (!exists()) {
287-
throw NoSuchElementException("File or directory not exists")
287+
throw NoSuchElementException("File or directory '${getAbsolutePath()}' not exists")
288288
}
289289

290290
if (length() == 0L) {
@@ -327,4 +327,4 @@ actual fun File.appendBytes(bytes: ByteArray) {
327327

328328
actual fun File.writeText(text: String) {
329329
writeBytes(text.encodeToByteArray(), O_RDWR or O_CREAT, strlen(text))
330-
}
330+
}

0 commit comments

Comments
 (0)