module Filename:Warning! this library assumes we are in a POSIX compliant OS. It will not work properly under windows.sig..end
val root : stringval realpath : string -> stringrealpath pathUnix_error on errors.path.val is_posix_pathname_component : string -> boolis_posix_pathname_component ff is a valid filename in a POSIX compliant OS (a path
component and not a full path).
http://www.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html#tag_03_169
val temp_file : ?perm:int -> ?in_dir:string -> string -> string -> stringtemp_file ?perm ?in_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 a
6-digit hex number, then suffix. The temporary file is created empty. The
file is guaranteed to be fresh, i.e. not already existing in the directory.
perm : the permission of the temporary file. The default value is
0o600 (readable and writable only by the file owner)
Note that prefix and suffix will be changed when necessary to make the final filename valid POSIX.
in_dir : the directory in which to create the temporary fileval temp_dir : ?perm:int -> ?in_dir:string -> string -> string -> stringval open_temp_file : ?perm:int ->
?in_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. in Unix).val parent_dir_name : string.. in Unix).val dir_sep : string/ in Unix).val concat : string -> string -> stringconcat p1 p2 returns a path equivalent to p1 ^ "/" ^ p2.
In the resulting path p1 (resp. p2) has all its trailing (resp. leading)
"." and "/" removed. eg:
concat "a/." ".//b" => "a/b"
concat "." "b" => "./b"
concat "a" "." => "a/."
concat "a" "/b" => "a/b"val is_relative : string -> booltrue if the file name is relative to the current
directory, false if it is absolute (i.e. in Unix, starts
with /).val is_absolute : string -> boolval is_implicit : string -> booltrue if the file name is relative and does not start
with an explicit reference to the current directory (./ or
../ in Unix), false if it starts with an explicit reference
to the root directory or the current directory.val check_suffix : string -> string -> boolcheck_suffix name suff returns true if the filename name
ends with the suffix suff.val chop_suffix : string -> string -> stringchop_suffix name suff removes the suffix suff from
the filename name. The behavior is undefined if name does not
end with the suffix suff.val chop_extension : string -> string.xyz for instance.
Raise Invalid_argument if the given name does not contain
an extension.
val split_extension : string -> string * string optionsplit_extension fn return the portion of the filename before the
extension and the (optional) extensionval 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 parts : string -> string listparts filename returns a list of path components in order. For instance:
/tmp/foo/bar/baz -> "/"; "tmp"; "foo"; "bar"; "baz" val temp_dir_name : stringTMPDIR environment variable, or "/tmp"
if the variable is not set.
Under Windows, the value of the TEMP environment variable, or "."
if the variable is not set.val quote : string -> string