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 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)
|
return NSFileManager.defaultManager.createDirectoryAtURL(this, true, null, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actual fun delete(): Boolean {
|
||||||
|
return NSFileManager.defaultManager.removeItemAtURL(this, null)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun description(): String? {
|
override fun description(): String? {
|
||||||
return getAbsolutePath()
|
return getAbsolutePath()
|
||||||
|
|
|
@ -37,6 +37,10 @@ actual class File actual constructor(path: String) : java.io.File(path) {
|
||||||
return super.mkdirs()
|
return super.mkdirs()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actual override fun delete(): Boolean {
|
||||||
|
return super.delete()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return absolutePath
|
return absolutePath
|
||||||
|
|
Loading…
Reference in New Issue