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:

  • 0 Find all files and directories.

  • 1 Find all files.

  • 2 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")
    		

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.