AbsolutePath
[<Struct>]
type AbsolutePath =
| AbsolutePath of value: string| Assembly | Nacara.Core |
| Attributes | [<Struct>] |
An absolute path on disk, normalized to use / as its separator.
Normalizing at the boundary means paths compare and hash consistently on every platform
Cases
Functions and values
combine (root: AbsolutePath) (segments: string list) : AbsolutePath
combine (root: AbsolutePath) (segments: string list) : AbsolutePathCreate an absolute path by combining root with segments.
| Parameter | |
|---|---|
root | Where to start from. |
segments | What to append. A segment that is itself rooted wins outright, which is how an option holding an absolute path overrides a project-relative one. |
create (value: string) : AbsolutePath
create (value: string) : AbsolutePathCreate an absolute path, failing when value is not rooted.
| Parameter | |
|---|---|
value | A rooted path. It is normalised - resolved, and written with forward slashes on every platform - so two spellings of one path compare equal. |
| Raises | |
|---|---|
System.ArgumentException | The path is empty, or is relative. |
directory (AbsolutePath) : AbsolutePath
directory (AbsolutePath) : AbsolutePathThe directory holding it.
exists (AbsolutePath) : bool
exists (AbsolutePath) : boolWhether anything is there: a file or a directory.
extension (AbsolutePath) : string
extension (AbsolutePath) : stringThe extension, dot included, or an empty string when there is none.
fileName (AbsolutePath) : string
fileName (AbsolutePath) : stringThe last segment, extension included.
toLog (AbsolutePath) : string
toLog (AbsolutePath) : stringQuoted form used in log and diagnostic messages.
value (AbsolutePath) : string
value (AbsolutePath) : stringThe path as text, normalised, for the APIs that take a string.