package spotlib
Module Spotlib.FilepathSource
File path normalization. It does not access to the actual file system
The type of path
is_prefix a b checks a is a perfix of b.
For example,
is_prefix /a/b/c /a/b/c/d/e = Some ["d"; "e"] is_prefix a/b/c a/b/c/d/e = Some ["d"; "e"]
Normalize the path.
* Drive name capitalization/uncapitalization * Use backslashes in Win32 * Elimination of redundant /./ and /../, if possible.
Split the path into its directory and base parts.
If the path is the root, it returns None.
It fails and raises Invalid_argument "dirbase", when the path ends with "..".
Concatenation.
t ^/ "hello/world"
t ^/ x raises Invalid_argument "(^/)" when x is a string of an absolute path.
Concatenation+
concats t ["hello"; "world"; "good/bye"]
should equal to
t ^/ "hello" ^/ "world" ^/ "good" ^/ "bye"
It raises Invalid_argument "(^/)" when the path components contain an absolute path.