class Path
source · line 12public class Path private constructor(private val bytes: Array<Byte>) : Equals<Path>, Hash
- Supertype
Equals<Path> - Supertype
Hash
An immutable native byte path with no embedded NUL. Lexical operations do not access the filesystem or resolve symbolic links; equality compares stored bytes.
Extensions
public fun Path.readSymbolicLink(): Path· scoop:scoop.platform:0.1.0public fun Path.createSymbolicLink(target: Path, targetIsDirectory: Boolean = false): Unit· scoop:scoop.platform:0.1.0public fun Path.createDirectories(mode: Int = 0x1ff): Unit· scoop:scoop.platform:0.1.0public fun Path.copyTo(destination: Path, replaceExisting: Boolean = false): Long· scoop:scoop.platform:0.1.0public fun Path.metadata(followLinks: Boolean = true): FileMetadata· scoop:scoop.platform:0.1.0public fun Path.deleteRecursively(): Unit· scoop:scoop.platform:0.1.0public fun Path.readTextLossy(): String· scoop:scoop.platform:0.1.0public fun Path.canonicalize(): Path· scoop:scoop.platform:0.1.0public fun Path.entries(): DirectoryEntries· scoop:scoop.platform:0.1.0public fun Path.unixMetadata(followLinks: Boolean = true): UnixFileMetadata· scoop:scoop.os.nix:0.1.0public fun Path.createFifo(mode: Int): Unit· scoop:scoop.os.nix:0.1.0public fun Path.readText(): String· scoop:scoop.platform:0.1.0public fun Path.writeAllBytes(bytes: List<Byte>, append: Boolean = false): Unit· scoop:scoop.platform:0.1.0public fun Path.delete(): Unit· scoop:scoop.platform:0.1.0public fun Path.readAllBytes(): Array<Byte>· scoop:scoop.platform:0.1.0public fun Path.exists(followLinks: Boolean = true): Boolean· scoop:scoop.platform:0.1.0@Unsafe public fun <R> Path.withNativePath(block: (Ptr<Byte>) -> R): R· scoop:scoop.platform:0.1.0public fun Path.moveTo(destination: Path, replaceExisting: Boolean = false): Unit· scoop:scoop.platform:0.1.0public fun Path.createDirectory(mode: Int = 0x1ff): Unit· scoop:scoop.platform:0.1.0public fun Path.writeText(text: String, append: Boolean = false): Unit· scoop:scoop.platform:0.1.0
function decodeUtf8
source · line 181public fun decodeUtf8(): String
Decodes the stored bytes as strict UTF-8, rejecting malformed encoding.
function equals
source · line 193public override operator fun equals(other: Path): Boolean
- Overrides
equals
Compares the exact stored byte sequences.
parameter other
source · line 193other: Path
function components
source · line 69public fun components(): Array<OsString>
Returns nonempty components after the target's native path prefix and root.
property isAbsolute
source · line 17public val isAbsolute: Boolean
get: public read-only
Whether the path is fully qualified under the compilation target's rules.
getter get
source · line 17get(): Boolean
function hash
source · line 198public override fun hash(): Long
- Overrides
hash
Hashes the stored bytes consistently with equality.
function resolve
source · line 93public fun resolve(child: Path): Path
Joins a relative child to this path. A prefixed or absolute child replaces the base; a Windows rooted child retains the base's prefix.
parameter child
source · line 93child: Path
function decodeUtf8Lossy
source · line 185public fun decodeUtf8Lossy(): String
Decodes stored bytes with replacement for malformed UTF-8.
function normalizeLexically
source · line 134public fun normalizeLexically(): Path
Removes redundant separators and dot components and folds lexical dot-dot pairs. It does not follow links or guarantee equivalence through symbolic links.
function toOsString
source · line 177public fun toOsString(): OsString
Copies the stored path bytes into an operating-system string.
property parent
source · line 37public val parent: Path?
get: public read-only
The lexical parent when one exists; this does not query the filesystem.
getter get
source · line 37get(): Option<Path>
function display
source · line 189public fun display(): String
Returns a lossy UTF-8 presentation suitable for displaying native names.
property fileName
source · line 22public val fileName: OsString?
get: public read-only
The last non-separator component, or None for a root, empty path, dot, or dot-dot component.
getter get
source · line 22get(): Option<OsString>