|
| (+) [Fpath] |
p + ext is add_ext ext p.
|
| (-+) [Fpath] |
p -+ ext is set_ext ext p.
|
| (/) [Fpath] |
|
| (//) [Fpath] |
|
A |
| add_ext [Fpath] |
add_ext ext p is p with the string ext concatenated to p's
basename, if non empty.
|
| add_seg [Fpath] |
add_seg p seg adds segment seg to the segments of p if
p's last segment is non-empty or replaces the last empty
segment with seg.
|
| append [Fpath] |
append p q appends q to p as follows:
If q is absolute or has a non-empty volume then
q is returned., Otherwise appends q's segments to p using Fpath.add_seg.
Examples.
|
B |
| base [Fpath] |
base p is snd (split_base p).
|
| basename [Fpath] |
basename p is p's last non-empty segment if non-relative or
the empty string otherwise.
|
C |
| choose [Fpath.Map] |
Exception safe Map.S.choose.
|
| choose [Fpath.Set] |
Exception safe Set.S.choose.
|
| compare [Fpath] |
compare p p' is a total order on paths compatible with Fpath.equal.
|
D |
| dir_sep [Fpath] |
dir_sep is the platform dependent natural directory separator.
|
| dom [Fpath.Map] |
dom m is the domain of m.
|
| dump [Fpath.Map] |
dump pp_v ppf m prints an unspecified representation of m on
ppf using pp_v to print the map codomain elements.
|
| dump [Fpath.Set] |
dump ppf ps prints an unspecified representation of ps on
ppf.
|
| dump [Fpath] |
dump ppf p prints path p on ppf using String.dump.
|
E |
| equal [Fpath] |
equal p p' is true if p and p' have the same volume
are both relative or absolute and have the same segments.
|
| exists_ext [Fpath] |
exists_ext ~multi p is true iff p's basename
file extension is not empty.
|
F |
| filename [Fpath] |
filename p is the file name of p.
|
| find [Fpath.Map] |
Exception safe Map.S.find.
|
| find [Fpath.Set] |
Exception safe Set.S.find.
|
| find_prefix [Fpath] |
find_prefix p p' is Some prefix if there exists prefix such
that prefix is the longest path with is_prefix prefix p &&
is_prefix prefix p' = true and None otherwise.
|
G |
| get [Fpath.Map] |
get k m is like Map.S.find but raises Invalid_argument if
k is not bound in m.
|
| get [Fpath.Set] |
get is like Set.S.find but
|
| get_any_binding [Fpath.Map] |
|
| get_any_elt [Fpath.Set] |
|
| get_ext [Fpath] |
get_ext p is p's basename file extension or the
empty string if there is no extension.
|
| get_max_binding [Fpath.Map] |
|
| get_max_elt [Fpath.Set] |
|
| get_min_binding [Fpath.Map] |
|
| get_min_elt [Fpath.Set] |
|
H |
| has_ext [Fpath] |
has_ext e p is true iff get_ext p = e || get_ext ~multi:true p = e.
|
I |
| is_abs [Fpath] |
is_abs p is true iff p is an absolute path, i.e.
|
| is_current_dir [Fpath] |
is_current_dir p is true iff p is the current relative directory,
i.e.
|
| is_dir_path [Fpath] |
is_dir_path p is true iff p represents a directory.
|
| is_dotfile [Fpath] |
is_dotfile p is true iff p's basename is non
empty and starts with a '.'.
|
| is_file_path [Fpath] |
is_file_path p is true iff p represents a file.
|
| is_parent_dir [Fpath] |
is_parent_dir p is true iff p is the relative parent directory,
i.e.
|
| is_prefix [Fpath] |
is_prefix prefix p is true if prefix is a prefix of
p.
|
| is_rel [Fpath] |
is_rel p is true iff p is a relative path, i.e.
|
| is_rel_seg [Fpath] |
is_rel_seg s is true iff s is a relative segment, that is
"." or "..".
|
| is_root [Fpath] |
is_root p is true iff p is a root directory, i.e.
|
| is_rooted [Fpath] |
is_rooted root p is true iff the path p is the
directory root or contained in root and that p
can be relativized w.r.t.
|
| is_seg [Fpath] |
is_seg s is true iff s does not contain Fpath.dir_sep or '/' or
a 0x00 byte.
|
M |
| max_binding [Fpath.Map] |
Exception safe Map.S.max_binding.
|
| max_elt [Fpath.Set] |
Exception safe Set.S.max_elt.
|
| mem_ext [Fpath] |
mem_ext exts p is
List.mem (get_ext p) exts || List.mem (get_ext ~multi:true p) exts.
|
| min_binding [Fpath.Map] |
Exception safe Map.S.min_binding.
|
| min_elt [Fpath.Set] |
Exception safe Set.S.min_elt.
|
N |
| normalize [Fpath] |
normalize p is a path that represents the same path as p,
directoryness included, and that has the following
properties:
If p is absolute the resulting path has no "." and ".."
segments., If p is relative the resulting path is either "./" or
it has no "." segments and ".." segments may only appear as
initial segments., If p is a directory it always end with
an empty segment; this means it doesn't end with "." or "..".
Examples.
|
O |
| of_list [Fpath.Map] |
of_list bs is List.fold_left (fun m (k, v) -> add k v m) empty
bs.
|
| of_list [Fpath.Set] |
of_list ps is a set from the list ps.
|
| of_string [Fpath] |
of_string s is the string s as a path.
|
P |
| parent [Fpath] |
|
| pp [Fpath.Map] |
pp ~sep pp_binding ppf m formats the bindings of m on
ppf.
|
| pp [Fpath.Set] |
pp ~sep pp_elt ppf ps formats the elements of ps on
ppf.
|
| pp [Fpath] |
|
R |
| relativize [Fpath] |
relativize ~root p is:
Some q if there exists a relative path q such
that root // q and p represent the same paths,
directoryness included. They may however differ
syntactically when converted to a string. Note that q is
normalized., None otherwise.
|
| rem_empty_seg [Fpath] |
rem_empty_seg p removes an existing last empty segment of p if p
is not a root path.
|
| rem_ext [Fpath] |
rem_ext p is p with the extension of p's
basename removed.
|
| rem_prefix [Fpath] |
rem_prefix prefix p is:
None if prefix is not a prefix of p or if prefix
and p are equal., Some q otherwise where q is p without the
prefix prefix and preserves p's
directoryness. This means that q is a always
relative and that the path prefix // q and p represent the
same paths. They may however differ syntactically when
converted to a string.
Examples.
|
S |
| segs [Fpath] |
segs p is p's non-empty list of segments.
|
| set_ext [Fpath] |
set_ext ?multi ext p is add_ext ext (rem_ext ?multi p).
|
| split_base [Fpath] |
split_base p splits p into a directory d and a relative
base path b such that:
b is a relative path that contains the segments of p
that start at the last non-empty segment. This means
that b has a single non-empty segment, and preserves
directoryness of p. If p is a
root path there are no such segments and b
is "./"., d is a directory such that d // b
represents the same path as p. They may however differ
syntactically when converted to a string.
Examples.
|
| split_ext [Fpath] |
split_ext ?multi p is (rem_ext ?multi p, get_ext ?multi p).
|
| split_volume [Fpath] |
split_volume p is the pair (vol, q) where vol is
the platform dependent volume of p or the empty string
if there is none and q the path p without its volume, that is
its optional root Fpath.dir_sep and segments.
|
T |
| to_dir_path [Fpath] |
|
| to_string [Fpath] |
to_string p is the path p as a string.
|
V |
| v [Fpath] |
v s is the string s as a path.
|