abla/fs/path

Generated from source.

Import with import "abla/fs/path".

Source: abla/fs/path/entry.ab

pathHostIsWindows (fun)

fun pathHostIsWindows(): bool

Reports whether host paths use Windows rules: true in a program running on Windows (linuxHostIsWindows, the one function here that asks the host, once).

pathRootLength (fun)

fun pathRootLength(text: string, windows: bool): int

The length of the root's text (0 when the path has none): the bytes that no parent removes and name never includes.

pathIsAbsolute (fun)

fun pathIsAbsolute(text: string, windows: bool): bool

Absolute: the root names a place by itself. A POSIX root, a Windows drive with its separator, UNC, verbatim and device roots are; \dir (the current drive's) and C:dir (the drive's current directory) are not.

pathParent (fun)

fun pathParent(text: string, windows: bool): string

What is left when the last name goes: "." for a relative path of one name, the root for a root and a name under it, and the root itself for a root. The bytes before the last separator are kept as written (a//b has the parent a/).

pathName (fun)

fun pathName(text: string, windows: bool): string

The last name, without trailing separators ("" for a root and for ""); C: and C:\ have none.

pathExtension (fun)

fun pathExtension(text: string, windows: bool): string

After the last dot of the name when the dot is neither first nor last ("" otherwise).

pathJoin (fun)

fun pathJoin(base: string, name: string, windows: bool): string

base and name with one separator between them (/, or \ for the Windows syntax); none when base ends with one, and none after a bare drive (C: + x is C:x, the drive-relative path).

pathComponents (fun)

fun pathComponents(text: string, windows: bool): array<string>

The names after the root, in order, without empty ones (repeated separators) and without ".".

pathNormalize (fun)

fun pathNormalize(text: string, windows: bool): string

The lexical normal form: the root in the syntax's separator, repeated separators and "." gone, each ".." removing the name before it (kept at the start of a relative path, dropped at a root), "." for an empty result. Verbatim paths (\\?\) are returned as written: the system gives them no such meaning. It never looks at the file system (a symbolic link before a ".." is not followed), so it is the identity of a path, not its target.

pathToCanonical (fun)

fun pathToCanonical(text: string, windows: bool): string

The /-separated form Abla's tools key caches and build files by: a Windows path with its \ turned into /. A POSIX path is returned as it is (a \ is a name byte there).

pathToNative (fun)

fun pathToNative(text: string, windows: bool): string

The form the host's calls take: the Windows syntax with \, a POSIX path as it is.

Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.