summaryrefslogtreecommitdiff
path: root/stdlib/filename.mli
diff options
context:
space:
mode:
authorMaxence Guesdon <maxence.guesdon@inria.fr>2001-10-26 22:37:14 +0000
committerMaxence Guesdon <maxence.guesdon@inria.fr>2001-10-26 22:37:14 +0000
commita692df441cf8fd5690f41fe38ae94151337b4ebe (patch)
tree28005419623633ab88e4a580aba2d29531d97e96 /stdlib/filename.mli
parent91f3863d3ef863133bd888932f157a1ef254d969 (diff)
downloadocaml-a692df441cf8fd5690f41fe38ae94151337b4ebe.tar.gz
Modification emplacement et syntaxe des commentaires pour OCamldoc
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3924 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib/filename.mli')
-rw-r--r--stdlib/filename.mli107
1 files changed, 60 insertions, 47 deletions
diff --git a/stdlib/filename.mli b/stdlib/filename.mli
index 1077bf08b1..066623931d 100644
--- a/stdlib/filename.mli
+++ b/stdlib/filename.mli
@@ -12,63 +12,76 @@
(* $Id$ *)
-(* Module [Filename]: operations on file names *)
+(** Operations on file names. *)
+(** The conventional name for the current directory (e.g. [.] in Unix). *)
val current_dir_name : string
- (* The conventional name for the current directory
- (e.g. [.] in Unix). *)
+
+(** The conventional name for the parent of the current directory
+ (e.g. [..] in Unix). *)
val parent_dir_name : string
- (* The conventional name for the parent of the current directory
- (e.g. [..] in Unix). *)
+
+(** [concat dir file] returns a file name that designates file
+ [file] in directory [dir]. *)
val concat : string -> string -> string
- (* [concat dir file] returns a file name that designates file
- [file] in directory [dir]. *)
+
+(** Return [true] if the file name is relative to the current
+ directory, [false] if it is absolute (i.e. in Unix, starts
+ with [/]). *)
val is_relative : string -> bool
- (* Return [true] if the file name is relative to the current
- directory, [false] if it is absolute (i.e. in Unix, starts
- with [/]. *)
+
+(** Return [true] 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 is_implicit : string -> bool
- (* Return [true] 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. *)
+
+(** [check_suffix name suff] returns [true] if the filename [name]
+ ends with the suffix [suff]. *)
val check_suffix : string -> string -> bool
- (* [check_suffix name suff] returns [true] if the filename [name]
- ends with the suffix [suff]. *)
+
+(** [chop_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_suffix : string -> string -> string
- (* [chop_suffix name suff] removes the suffix [suff] from
- the filename [name]. The behavior is undefined if [name] does not
- end with the suffix [suff]. *)
+
+(** Return the given file name without its extension. The extension
+ is the shortest suffix starting with a period, [.xyz] for instance.
+
+ Raise [Invalid_argument] if the given name does not contain
+ a period. *)
val chop_extension : string -> string
- (* Return the given file name without its extension. The extension
- is the shortest suffix starting with a period, [.xyz] for instance.
- Raise [Invalid_argument] if the given name does not contain
- a period. *)
+
+(** Split a file name into directory name / base file name.
+ {!Filename.concat} [(]{!Filename.dirname}[ name) (]{!Filename.basename}[ name)]
+ returns a file name which is equivalent to [name]. Moreover, after setting the
+ current directory to {!Filename.dirname}[ name] (with {!Sys.chdir}),
+ references to {!Filename.basename}[ name] (which is a relative file name)
+ designate the same file as [name] before the call to {!Sys.chdir}. *)
val basename : string -> string
+
+(** See {!Filename.dirname}. *)
val dirname : 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]. *)
+
+(** [temp_file 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 suitably chosen integer number, then [suffix].
+ The temporary file is created empty, and is guaranteed to be
+ different from any other file that existed when [temp_file]
+ was called.
+ Under Unix, the temporary directory is [/tmp] by default; if set,
+ the value of the environment variable [TMPDIR] is used instead.
+ Under Windows, the name of the temporary directory is the
+ value of the environment variable [TEMP],
+ or [C:\temp] by default.
+ Under MacOS, the name of the temporary directory is given
+ by the environment variable [TempFolder]; if not set,
+ temporary files are created in the current directory. *)
val temp_file : string -> string -> string
- (* [temp_file 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 suitably chosen integer number, then [suffix].
- The temporary file is created empty, and is guaranteed to be
- different from any other file that existed when [temp_file]
- was called.
- Under Unix, the temporary directory is [/tmp] by default; if set,
- the value of the environment variable [TMPDIR] is used instead.
- Under Windows, the name of the temporary directory is the
- value of the environment variable [TEMP],
- or [C:\temp] by default.
- Under MacOS, the name of the temporary directory is given
- by the environment variable [TempFolder]; if not set,
- temporary files are created in the current directory. *)
+
+(** Return a quoted version of a file name, suitable for use as
+ one argument in a shell command line, escaping any shell
+ meta-characters. *)
val quote : string -> string;;
- (* Return a quoted version of a file name, suitable for use as
- one argument in a shell command line, escaping any shell
- meta-characters. *)
+