module type META_PATH_SPECIFICATION = functor (
OsOperation
:
OS_SPECIFICATION
) ->
PATH_SPECIFICATION
Meta structure to generate a module for
a new filesystem specification. See the
source code to know how to do it
type
filename
type
extension
Converting from/to string
val string_of_filename : filename -> string
Create a filename from a string
val filename_of_string : string -> filename
Create a string from a filename
val make_filename : string list -> filename
Make a filename from set of strings
Ordering filename
val is_subdir : filename ->
filename -> bool
is_subdir fl1 fl2 : Is fl2 a sub directory of fl1
val is_updir : filename ->
filename -> bool
is_updir fl1 fl2 : Is fl1 a sub directory of fl2
val compare : filename ->
filename -> int
Give an order between the two filename. The classification is done by sub directory relation
( fl1 < subdir(fl1) ) and lexicographical order of each part of the reduce filename when fl1 and fl2
has no hierarchical relation
Manipulating/Splitting path
val basename : filename -> filename
Extract only the file name of a filename
val dirname : filename -> filename
Extract the directory name of a filename
val concat : filename ->
filename -> filename
Append a filename to the filename
val reduce : filename -> filename
Return the shortest filename which is equal to the filename given
val make_absolute : filename ->
filename -> filename
Create an absolute filename from a filename relative and an absolute base filename
val make_relative : filename ->
filename -> filename
Create a filename which is relative to the base filename
val reparent : filename ->
filename ->
filename -> filename
Reparent a filename : reparent fln_src fln_dst fln, return the same filename as fln
but the root is no more fln_src but fln_dst
val identity : filename -> filename
Identity : for testing the stability of implode/explode
val is_valid : filename -> bool
Test if the filename is a valid one
val is_relative : filename -> bool
Check if the filename is relative to a dir or not ( ie beginning with Component, ParentDir, CurrentDir )
val is_implicit : filename -> bool
Check if the filename is an absolute one or not ( ie beginning by a Root reference )
val is_current : filename -> bool
Check if the filename is a reference to current directory ( ie beginning with CurrentDir )
val is_parent : filename -> bool
Check if the filename is a reference to the parent directory ( ie beginning with ParentDir )
Manipulate the extension
val chop_extension : filename -> filename
Remove extension
val get_extension : filename -> extension
Extract the extension
val check_extension : filename ->
extension -> bool
Check the extension
val add_extension : filename ->
extension -> filename
Add an extension
val extension_of_string : string -> extension
Create an extension from a string
val string_of_extension : extension -> string
Create a string from an extension
Transformation of PATH like variable
val string_of_path : filename list -> string
Create an environnement PATH like string from different filename
val path_of_string : string -> filename list
Return the different filename of an environnement PATH like string
Generic component
val current_dir : filename
Return an identifier to the current dir
val parent_dir : filename
Return an identifier to the upper dir