NAME
get_dir - get information about files in a directory
SYNOPSIS
mixed **get_dir(string file)
CONFIG.H - MUDOS_GET_DIR_BEHAVIOUR
mixed **get_dir(string file, int flag)
DESCRIPTION
Get information about a file or files in a directory. The return
value is of the form
({ ({ file names }), ({ file sizes }), ({ file mod times }) })
If a file is a directory, the file size will be given as -2.
If the last path component of the specified file can be interpreted
as a regular expression, all files which match this regular expression
are collected. Otherwise, only the file itself is taken. If no files
match, or if the file is not present, the return value of get_dir()
will be ({ ({ }), ({ }), ({ }) }).
The following characters have a special meaning in a regular expression:
? any single character
* any (possibly empty) string
[a-z] any character in the range a-z
[^a-z] any character not in range a-z
\c the character c, not interpreted as having a special
meaning
The files will be sorted by file name.
Only as many files as specified by status()[ST_ARRAYSIZE], with
ST_ARRAYSIZE defined in the include file <status.h>, will be collected.
This_object() will also need read access to the path.
If config.h defines MUDOS_GET_DIR_BEHAVIOUR, the behaviour of
MudOS get_dir() will be simulated, but the structure of returnvalue
will not. It is recommended to use the native DGD get_dir() without
flag argument out of simplicity. The MudOS version is very confusing.
Get_files() will create a listing of files as with get_dir(, 1).
SEE ALSO
efun/get_files, kfun/make_dir, kfun/remove_dir