package file_path
Module File_pathSource
include S
Paths are a subtype of string.
type comparator_witness = Types.Path.comparator_witnessinclude Types.Type
with type t := t
and type comparator_witness := comparator_witness
include Ppx_compare_lib.Equal.S with type t := t
include Ppx_compare_lib.Comparable.S with type t := t
include Ppx_hash_lib.Hashable.S with type t := t
include Core.Comparator.S
with type t := t
with type comparator_witness := comparator_witness
Path types have straightforward to_string and sexp_of_t behavior. of_string and t_of_sexp raise on invalid input (e.g. containing null characters), and guarantee canonical output (e.g. no redundant slashes).
to_string is the identity function. of_string returns its input when the input is a valid string in canonical form.
include Core.Identifiable.S
with type t := t
and type comparator_witness := comparator_witness
include Bin_prot.Binable.S with type t := t
include Bin_prot.Binable.S_only_functions with type t := t
This function only needs implementation if t exposed to be a polymorphic variant. Despite what the type reads, this does *not* produce a function after reading; instead it takes the constructor tag (int) before reading and reads the rest of the variant t afterwards.
include Ppx_hash_lib.Hashable.S with type t := t
include Sexplib0.Sexpable.S with type t := t
include Ppx_compare_lib.Comparable.S with type t := t
include Ppx_hash_lib.Hashable.S with type t := t
include Base.Pretty_printer.S with type t := t
include Core.Comparable.S_binable
with type t := t
with type comparator_witness := comparator_witness
include Base.Comparable.S
with type t := t
with type comparator_witness := comparator_witness
include Base.Comparisons.S with type t := t
compare t1 t2 returns 0 if t1 is equal to t2, a negative integer if t1 is less than t2, and a positive integer if t1 is greater than t2.
ascending is identical to compare. descending x y = ascending y x. These are intended to be mnemonic when used like List.sort ~compare:ascending and List.sort ~cmp:descending, since they cause the list to be sorted in ascending or descending order, respectively.
clamp_exn t ~min ~max returns t', the closest value to t such that between t' ~low:min ~high:max is true.
Raises if not (min <= max).
include Base.Comparator.S
with type t := t
with type comparator_witness := comparator_witness
include Core.Comparator.S
with type t := t
with type comparator_witness := comparator_witness
val comparator : (t, comparator_witness) Base.Comparator.comparatormodule Map :
Core.Map.S_binable
with type Key.t = t
with type Key.comparator_witness = comparator_witnessmodule Set :
Core.Set.S_binable
with type Elt.t = t
with type Elt.comparator_witness = comparator_witnessinclude Core.Invariant.S with type t := t
Command-line argument. Supports tab-completion.
Returns the final part of the given path, or None if given root.
Returns the final part of the given path, or raises if given root.
Returns the final part of the given path, or returns an error if given root.
Returns the final part of the given path, or Part.dot if given root.
Returns all parts of the given path but the final one, or None if given root or a relative path of a single part.
Returns all parts of the given path but the final one, or raises if given root or a relative path of a single part.
Returns all parts of the given path but the final one, or returns an error if given root or a relative path of a single part.
Returns all parts of the given path but the final one, or root if given root, or dot if given a relative path of a single part.
Like Option.both (dirname t) (basename t). Allocates Some at most once.
Adds the given string as a suffix of the path's basename. Raises if t is root and therefore has no basename, or if the string contains characters that are illegal for a path part.
Adds a part to the end of the path.
Appends the parts of a relative path to the end of the path.
Reports if the parts of prefix are a non-strict prefix of the parts of the other argument, and the paths are both absolute or both relative.
Reports if the parts of suffix are a non-strict suffix of the parts of the other argument.
Returns all parts of the given path after prefix, or None if prefix is not a prefix of the path's parts. Always returns None if the path and prefix do not match in absolute/relative status. If the path equals prefix, returns dot.
Returns all parts of the given path after prefix, or raises if prefix is not a prefix of the path's parts. Always raises if the path and prefix do not match in absolute/relative status. If the path equals prefix, returns dot.
Returns all parts of the given path after prefix, or returns an error if prefix is not a prefix of the path's parts. Always returns an error if the path and prefix do not match in absolute/relative status. If the path equals prefix, returns dot.
Returns all parts of the given path after prefix, or returns the path unchanged if prefix is not a prefix of the path's parts. If the path equals prefix, returns dot.
Returns all parts of the given path before suffix, or None if suffix is not a suffix of the path's parts. If the path equals suffix, returns dot.
Returns all parts of the given path before suffix, or raises if suffix is not a suffix of the path's parts. If the path equals suffix, returns dot.
Returns all parts of the given path before suffix, or returns an error if suffix is not a suffix of the path's parts. If the path equals suffix, returns dot.
Returns all parts of the given path before suffix, or returns the path unchanged if suffix is not a suffix of the path's parts. If the path equals suffix, returns dot.
Removes . parts from the given path. Returns . if the given path is a relative path consisting only of one or more . parts.
Removes . parts from the given path. Cancels out .. parts with preceding parts (that are neither . nor ..). Removes any .. parts immediately following a leading /. Does not check the file system; in the presence of symlinks, the resulting path may not be equivalent. Returns . if the given path is a relative path and all parts are canceled out.
Returns a relative path consisting of the given part.
Produces the parts of the path.
Constructs an absolute path from the given parts.
Returns a relative path consisting of the given one or more parts, or None if the list of parts is empty.
Returns a relative path consisting of the given one or more parts, or raises if the list of parts is empty.
Returns a relative path consisting of the given one or more parts, or returns an error if the list of parts is empty.
Returns a relative path consisting of the given one or more parts, or dot if the list of parts is empty.
Returns a relative path consisting of the given one or more parts.
If t is absolute, returns t as an absolute path. If t is relative, returns Absolute.append under t.
If t is relative, returns t as a relative path. If t is absolute, returns chop_prefix t ~prefix:if_under.
If t is relative, returns t as a relative path. If t is absolute, returns chop_prefix_exn t ~prefix:if_under.
val make_relative_or_error :
t ->
if_under:Types.Absolute.t ->
Types.Relative.t Core.Or_error.tIf t is relative, returns t as a relative path. If t is absolute, returns chop_prefix_or_error t ~prefix:if_under.
If t is relative, returns t as a relative path. If t is absolute, returns chop_prefix_if_exists t ~prefix:if_under.
Converts an absolute path to a path. Is the identity function.
Converts a relative path to a path. Is the identity function.
Returns t as an absolute path, or None if it is relative.
Returns t as a relative path, or None if it is absolute.
Returns t as an absolute path, or raises if it is relative.
Returns t as a relative path, or raises if it is absolute.
Returns t as an absolute path, or returns an error if it is relative.
Returns t as a relative path, or returns an error if it is absolute.