File

expect class File(path: String)(source)

An abstract File implementation that works on different environments

actual class File(val path: String)(source)
actual class File(val path: String)(source)

Constructors

Link copied to clipboard
expect constructor(path: String)
actual constructor(path: String)
actual constructor(path: String)

Properties

Link copied to clipboard
expect val absolutePath: String

The absolute path of the File

actual val absolutePath: String
actual val absolutePath: String
Link copied to clipboard
expect val contents: CharArray

The contents of the File as a CharArray

actual val contents: CharArray
actual val contents: CharArray
Link copied to clipboard

The contents of the File as a String

Link copied to clipboard
expect val exists: Boolean

Does the file exist? (Boolean value)

actual val exists: Boolean
actual val exists: Boolean
Link copied to clipboard
expect val isAbsolute: Boolean

Is the file path absolute?

actual val isAbsolute: Boolean
actual val isAbsolute: Boolean
Link copied to clipboard
expect val isDirectory: Boolean

Is the File a directory and not a fine

actual val isDirectory: Boolean
actual val isDirectory: Boolean
Link copied to clipboard
expect val isFile: Boolean

Is the File a file and not a directory

actual val isFile: Boolean
actual val isFile: Boolean
Link copied to clipboard
val lstats: dynamic
Link copied to clipboard
expect val name: String

The name of the File

actual val name: String
actual val name: String
Link copied to clipboard
expect val parent: File

The parent File

actual val parent: File
actual val parent: File
Link copied to clipboard
expect val parentPath: String

The parent file's path

actual val parentPath: String
actual val parentPath: String
Link copied to clipboard
expect val path: String

The path of the File

actual val path: String
actual val path: String

Functions

Link copied to clipboard
expect fun mkdir()

Create the file as directory

actual fun mkdir()
actual fun mkdir()
Link copied to clipboard
expect fun mkdirs()

Create the file as directory and it's parent directories

actual fun mkdirs()
actual fun mkdirs()
Link copied to clipboard
expect fun write(content: CharArray)

Write a char array

expect fun write(content: String)

Write a string to the file

actual fun write(content: CharArray)
actual fun write(content: String)
actual fun write(content: CharArray)
actual fun write(content: String)