directory

directory — returns the contents of a directory.

Syntax

directory (path, filetypes, fullpaths)

		

Arguments

path

A path to a directory as defined by the operating system.

filetypes

A number in the range 0 to 2:

    Find all files and directories.

    Find all files.

    Find all directories.

fullpaths

If non-nil, show the full pathname of the file by prepending the path to all filenames.

Returns

A list containing all of the requested directory entries as strings.

Example

Gamma> directory("/usr",0,nil);	
("local" "lib" "bin" "readme")
Gamma> sort(directory("/usr",2,t),strcmp); 
("/usr/bin" "/usr/lib" "/usr/local")