list. Getting directory listing

^file:list[path]
^file:list[path;filter]   

Makes up a table (object of class
table) containing one column-name-containing files and directories-within specified directory-matching pattern, if specified.

filter-a regular expression (see also method match of class string) used to specify a pattern for names of file to match. It could be specified as a string or regex-object [3.4.0]. If filter is not specified, all files located in specified directory will be listed.

Example
$list[^file:list[/;\.zip^$]]
^list.
menu{
   $list.name
<br />
}

Will output the names of all archives with extension
.zip, located in web-server's root directory.


Copyright © 1997–2010 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 29.06.2009