module Directory:sig
..end
val list : ?absolute:bool -> ?path:bool -> string -> string list
list dir
returns the alphabetically sorted list
of the names of the files contained in directory dir
.
The special names that refer to the parent directory (e.g. ..
)
and the directory itself (e.g. .
) are ignored.
If the option absolute
is set to true
, the result is a list
of absolute file paths, i.e. that do not depend on the current directory
which is associated to the process
(default is false; implies path = true
).
If the option path
is set to true
, the result is a list of paths
instead of just the file names
(default is false
except if absolute
is explicitely set to true
).
Exception Invalid_argument "Directory.list"
is raised
if there is an incompatibility between the options.
Unspecified exceptions will be raised if the given directory does not
exist or is not readable.
val is_dir : ?nofollow:bool -> string -> bool
is_dir dir
returns true if dir
is a directory, false otherwise.
The nofollow
option is false by default, but if true,
a symbolic link will not be followed. In that case false is returned
even if the link points to a valid directory.