package volgo
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=2714935a34417be2151736a4765431746c9348db5a3b4f0eaacaf74dfaefeabb
sha512=0eba27395125ae928fd53561029d9653094d822b2907cb9afc18f412b46ef47cf880ba80d1bf17212add4e68e6a55e2792176303e2b0bcee08940e25731b4738
doc/volgo.stdlib/Volgo_stdlib/Absolute_path/index.html
Module Volgo_stdlib.Absolute_pathSource
include module type of struct include Fpath_sexp0.Absolute_path end
The type of absolute paths.
Note: Some versions of odoc may display this as type t = Fpath.t, but the actual definition is: type t = private Fpath.t, which enforces the following invariants:
- The path is absolute (starts with
"/") - The path is normalized via
Fpath.normalize, so all".."segments are resolved
of_fpath p returns p normalized via Fpath.normalize and classified as an absolute path. Returns None if p is not an absolute path.
This is a convenient wrapper to compose Fpath.of_string and of_fpath.
append abs rel appends relative path rel to absolute path abs and normalizes the result via Fpath.normalize.
The result is guaranteed to stay at or below abs in the directory tree, since relative_path values cannot escape upward.
extend abs seg appends filesystem segment seg to absolute path abs and normalizes the result via Fpath.normalize.
chop_prefix t ~prefix removes prefix prefix from path t. Returns Some result where result is t with prefix removed, or None if prefix is not actually a prefix of t.
When t equals prefix, returns Some empty where empty is the empty relative path "./".
chop_suffix t ~suffix removes suffix suffix from path t.
Returns Some result where result is t with suffix removed, or None if suffix is not actually a suffix of t. When suffix is the empty relative path "./", returns Some t unchanged.
When a non-empty suffix is successfully removed, the result is a directory path.