Skip to content

Commit 31f637b

Browse files
author
Eduard Obolenskiy
committed
add print logs
1 parent e06d84f commit 31f637b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/mingwX64Main/kotlin/File.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,26 @@ actual class File actual constructor(pathname: String) {
6060
}
6161

6262
actual fun mkdir(): Boolean {
63+
println("parentfile exists: ${getParentFile()?.exists()}")
6364
if (getParentFile()?.exists() != true) {
6465
return false
6566
}
6667

68+
println("parentfile canwrite: ${getParentFile()?.canWrite()}")
6769
if (getParentFile()?.canWrite() != true) {
68-
throw IllegalFileAccess(pathname, "Directory not accessible for write operations")
70+
throw IllegalFileAccess(getAbsolutePath(), "Directory not accessible for write operations")
6971
}
7072

71-
return SHCreateDirectoryExA(null, pathname, null) == ERROR_SUCCESS
73+
return SHCreateDirectoryExA(null, getAbsolutePath(), null) == ERROR_SUCCESS
7274
}
7375

7476
actual fun mkdirs(): Boolean {
77+
println("mkdirs exists: ${exists()}")
7578
if (exists()) {
7679
return false
7780
}
7881

79-
if (mkdir()) {
82+
if (mkdir().apply { println("parentfile canwrite: $this") }) {
8083
return true
8184
}
8285

0 commit comments

Comments
 (0)