tur/path-string
owned String siblings for stdlib/path.
The tur/path functions return a freshly-allocated cstr the caller must free (a borrowed-typed owned buffer -- the exact hazard the owned String type fixes; see string-adoption-stdlib-plan.md). This opt-in module layers an owned-String surface on top: each path/*-string wraps the corresponding path/* in string/adopt-cstr, so the malloc'd path is adopted into an owned String with no leak and no free obligation.
It is a SEPARATE module so the lean tur/path (no map/typeclass dependency) stays lean: only programs that want owned path Strings load this and pull in stdlib/string.
Note: these compose inline-C path/* helpers, so like tur/path itself they run on the compiled path; use the underlying path/* cstr forms under --interpret.
Since: v2 (string-adoption-stdlib-plan, batch 1)
path/join-string
(path/join-string [base :cstr segment :cstr] :String)
join two path segments, returning an owned String.
(string/to-cstr (path/join-string "/usr" "local")) ; => "/usr/local"
Since: v2
path/basename-string
(path/basename-string [p :cstr] :String)
final path component, as an owned String.
Since: v2
path/dirname-string
(path/dirname-string [p :cstr] :String)
parent directory, as an owned String.
Since: v2
path/extension-string
(path/extension-string [p :cstr] :String)
file extension, as an owned String.
Since: v2
path/stem-string
(path/stem-string [p :cstr] :String)
basename without its extension, as an owned String.
Since: v2
path/normalize-string
(path/normalize-string [p :cstr] :String)
normalized path, as an owned String.
Since: v2