Path

expect class Path(source)

A wrapper around a string representing a file path allowing to read from and write to a corresponding file using Sink and Source.

This API is unstable and subject to change.

actual class Path(source)
actual class Path(source)
actual class Path(source)
actual class Path(source)

Properties

Link copied to clipboard
expect val isAbsolute: Boolean

Returns true if this path is absolute, false otherwise.

actual val isAbsolute: Boolean
actual val isAbsolute: Boolean
actual val isAbsolute: Boolean
actual val isAbsolute: Boolean
Link copied to clipboard
expect val name: String

Returns the name of the file or directory represented by this path.

actual val name: String
actual val name: String
actual val name: String
actual val name: String
Link copied to clipboard
expect val parent: Path?

Returns a path representing a parent directory for this path, or null if there is no parent directory for this path.

actual val parent: Path?
actual val parent: Path?
actual val parent: Path?
actual val parent: Path?

Functions

Link copied to clipboard
expect open operator override fun equals(other: Any?): Boolean

Compares two paths for equality using its string representation (toString).

actual open operator override fun equals(other: Any?): Boolean
actual open operator override fun equals(other: Any?): Boolean
actual open operator override fun equals(other: Any?): Boolean
actual open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
expect open override fun hashCode(): Int

Returns hash code of this Path. The hash code is calculated for the path's string representations (toString).

actual open override fun hashCode(): Int
actual open override fun hashCode(): Int
actual open override fun hashCode(): Int
actual open override fun hashCode(): Int
Link copied to clipboard
@JvmName(name = "sinkDeprecated")
fun Path.sink(): Sink

Returns RawSink for the given path, creates file if it doesn't exist, throws if it's a directory, overwrites contents.

Link copied to clipboard
@JvmName(name = "sourceDeprecated")
fun Path.source(): Source

Returns RawSource for the given file or throws if path is not a file or does not exist

Link copied to clipboard
expect open override fun toString(): String

Returns a string representation of this path.

actual open override fun toString(): String
actual open override fun toString(): String
actual open override fun toString(): String
actual open override fun toString(): String