Implemented deleting files
This commit is contained in:
parent
8cac7b52ee
commit
40bbb2b8f5
|
@ -18,4 +18,6 @@ expect class File(path: String) {
|
|||
|
||||
fun mkdirs(): Boolean
|
||||
|
||||
fun delete(): Boolean
|
||||
|
||||
}
|
|
@ -27,6 +27,10 @@ actual class File actual constructor(path: String) : NSURL(fileURLWithPath = pat
|
|||
return NSFileManager.defaultManager.createDirectoryAtURL(this, true, null, null)
|
||||
}
|
||||
|
||||
actual fun delete(): Boolean {
|
||||
return NSFileManager.defaultManager.removeItemAtURL(this, null)
|
||||
}
|
||||
|
||||
|
||||
override fun description(): String? {
|
||||
return getAbsolutePath()
|
||||
|
|
|
@ -37,6 +37,10 @@ actual class File actual constructor(path: String) : java.io.File(path) {
|
|||
return super.mkdirs()
|
||||
}
|
||||
|
||||
actual override fun delete(): Boolean {
|
||||
return super.delete()
|
||||
}
|
||||
|
||||
|
||||
override fun toString(): String {
|
||||
return absolutePath
|
||||
|
|
Loading…
Reference in New Issue