123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183open!Core(** A relative path represents one or more path parts relative to some unspecified
"current" directory.
Valid relative path strings must be non-empty, must contain no null characters, and
must not start with a slash.
Canonical relative path strings must contain no consecutive slashes and must not end
in a slash. *)moduletypeS=sigmoduleTypes:Types.SopenTypes(** Relative paths are a subtype of [Path.t] and therefore also of [string]. *)includeCommon.SwithmoduleType:=Types.RelativeincludeQuickcheckable.Swithtypet:=t(** The current directory, i.e. [.]. *)valdot:t(** The parent directory, i.e. [..]. *)valdot_dot:t(** Returns the final part of the given path. *)valbasename:t->Part.t(** Returns all parts of the given path but the final one, or [None] if the path has
only one part. *)valdirname:t->toption(** Returns all parts of the given path but the final one, or raises if the path has
only one part. *)valdirname_exn:t->t(** Returns all parts of the given path but the final one, or returns an error if the
path has only one part. *)valdirname_or_error:t->tOr_error.t(** Returns all parts of the given path but the final one, or [dot] if the path has only
one part. *)valdirname_defaulting_to_dot:t->t(** Returns the first part of a multiple-part path, or [None] if given a single-part
path. *)valtop_dir:t->Part.toption(** Returns the first part of a multiple-part path, or raises if given a single-part
path. *)valtop_dir_exn:t->Part.t(** Returns the first part of a multiple-part path, or returns an error if given a
single-part path. *)valtop_dir_or_error:t->Part.tOr_error.t(** Returns the first part of a multiple-part path, or [Part.dot] if given a single-part
path. *)valtop_dir_defaulting_to_dot:t->Part.t(** Returns all but the first part of a multiple-part relative path, or [None] if given
a single-part path. *)valall_but_top_dir:t->toption(** Returns all but the first part of a multiple-part relative path, or raises if given
a single-part path. *)valall_but_top_dir_exn:t->t(** Returns all but the first part of a multiple-part relative path, or returns an error
if given a single-part path. *)valall_but_top_dir_or_error:t->tOr_error.t(** Returns all but the first part of a multiple-part relative path, or returns the path
unchanged if given a single-part path. *)valall_but_top_dir_defaulting_to_self:t->t(** Like [Option.both (top_dir t) (all_but_top_dir t)]. Allocates [Some] at most
once. *)valtop_dir_and_all_but_top_dir:t->(Part.t*t)option(** Adds the given string as a suffix of the path's basename. Raises if the string
contains characters that are illegal for a path part. *)valappend_to_basename_exn:t->string->t(** Adds a part to the beginning of the path. *)valprepend_part:Part.t->t->t(** Adds a part to the end of the path. *)valappend_part:t->Part.t->t(** Appends the parts of two paths. *)valappend:t->t->t(** Reports if the parts of [prefix] are a non-strict prefix of the parts of the other
argument. *)valis_prefix:t->prefix:t->bool(** Reports if the parts of [suffix] are a non-strict suffix of the parts of the other
argument. *)valis_suffix:t->suffix:t->bool(** Returns all parts of the given path after [prefix], or [None] if [prefix] is not a
prefix of the path's parts. If the path equals [prefix], returns [dot]. *)valchop_prefix:t->prefix:t->toption(** Returns all parts of the given path after [prefix], or raises if [prefix] is not a
prefix of the path's parts. If the path equals [prefix], returns [dot]. *)valchop_prefix_exn:t->prefix:t->t(** Returns all parts of the given path after [prefix], or returns an error if [prefix]
is not a prefix of the path's parts. If the path equals [prefix], returns [dot]. *)valchop_prefix_or_error:t->prefix:t->tOr_error.t(** 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]. *)valchop_prefix_if_exists:t->prefix:t->t(** 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]. *)valchop_suffix:t->suffix:t->toption(** 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]. *)valchop_suffix_exn:t->suffix:t->t(** 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]. *)valchop_suffix_or_error:t->suffix:t->tOr_error.t(** 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]. *)valchop_suffix_if_exists:t->suffix:t->t(** Removes [.] parts from the given path. Returns [.] if the given path consists only
of one or more [.] parts. *)valsimplify_dot:t->t(** Removes [.] parts from the given path. Cancels out [..] parts with preceding parts
(that are neither [.] nor [..]). Does not check the file system; in the presence of
symlinks, the resulting path may not be equivalent. Returns [.] if all parts are
canceled out. *)valsimplify_dot_and_dot_dot_naively:t->t(** Returns a path consisting of the single given part. *)valof_part:Part.t->t(** Produces the parts of the path. *)valto_parts:t->Part.tlist(** Produces the parts of the path. *)valto_parts_nonempty:t->Part.tNonempty_list.t(** Returns a relative path consisting of the given one or more parts, or [None] if the
list of parts is empty. *)valof_parts:Part.tlist->toption(** Returns a relative path consisting of the given one or more parts, or raises if the
list of parts is empty. *)valof_parts_exn:Part.tlist->t(** Returns a relative path consisting of the given one or more parts, or returns an
error if the list of parts is empty. *)valof_parts_or_error:Part.tlist->tOr_error.t(** Returns a relative path consisting of the given one or more parts, or [dot] if the
list of parts is empty. *)valof_parts_defaulting_to_dot:Part.tlist->t(** Returns a relative path consisting of the given one or more parts. *)valof_parts_nonempty:Part.tNonempty_list.t->t(** Equivalent to [List.length (to_parts t)], without allocating. *)valnumber_of_parts:t->intendmoduletypeRelative=sigmoduletypeS=SincludeSwithmoduleTypes:=TypesmoduleStable:Common.StablewithmoduleType:=Types.Relativeend