module Filename:Warning! this library assumes we are in a POSIX compliant OS. It will not work properly under windows (it doesn't handle drivenames).sig..end
val root : stringval normalize : string -> stringnormalize path
Removes as much "." and ".." from the path as possible. If the path is
absolute they will all be removed.val expand : ?cwd:string -> string -> stringexpand
Makes a path absolute by expanding . to cwd and ~ to home directories.
In case of error (e.g.: path home of a none existing user) raises Failure
with a (hopefully) helpful message.val parent : string -> stringparent pathpath the result is normalized
The parent of the root directory is the root directoryval unroot : path:string -> string -> stringunroot ~path f
returns f relative to path.Failure if is_relative f <> is_relative pathval is_posix_valid : string -> boolis_posix_valid fval temp_file : ?temp_dir:string -> string -> string -> stringtemp_file ?temp_dir_name prefix suffix
Returns the name of a fresh temporary file in the temporary directory. The
base name of the temporary file is formed by concatenating prefix, then, if
needed, a 6-digit hex number, then suffix. The temporary file is created
empty, with permissions 0o600 (readable and writable only by the file
owner). The file is guaranteed to be fresh, i.e. not already existing in
the directory.
temp_dir : the directory in which to create the temporary file
Note that prefix and suffix will be changed when necessary to make the final filename valid POSIX.
val explode : string -> string listval implode : string list -> stringval normalize_path : string list -> string listval temp_dir : ?in_dir:string -> string -> string -> stringval open_temp_file : ?temp_dir:string -> string -> string -> string * Pervasives.out_channelFilename.temp_file, but returns both the name of a fresh
temporary file, and an output channel opened (atomically) on
this file. This function is more secure than temp_file: there
is no risk that the temporary file will be modified (e.g. replaced
by a symbolic link) before the program opens it.val current_dir_name : string
val parent_dir_name : stringval concat : string -> string -> stringval is_relative : string -> boolval is_implicit : string -> boolval check_suffix : string -> string -> boolval chop_suffix : string -> string -> stringval chop_extension : string -> stringval basename : string -> string
Split a file name into directory name / base file name.
concat (dirname name) (basename name) returns a file name
which is equivalent to name. Moreover, after setting the
current directory to dirname name (with Sys.chdir),
references to basename name (which is a relative file name)
designate the same file as name before the call to Sys.chdir.
The result is not specified if the argument is not a valid file name
(for example, under Unix if there is a NUL character in the string).
val dirname : string -> stringFilename.basename.val split : string -> string * stringsplit filename returns (dirname filename, basename filename)val temp_dir_name : stringval quote : string -> string