Home > Contents > Index >
FILELIST
Constructs a list of the file names found in a folder.
Syntax
<FILELIST NAME="LIST_NAME" PATH="PATH_NAME" [FILTER="FILTER_VAL"] [RECURSIVE="RECURSIVE_VAL"] [LIMIT="MAX_NO_FILES"]/>Parameters
NAME (required)- List of files found.
PATH (required)- Folder to scan.
FILTER (optional)- File filter to use. Possible filters are *.* or *.
RECURSIVE (optional)- Whether to list subfolders. Possible values are
trueorfalse.
LIMIT (optional)- The maximum number of file names to return in the list.
Description
The
FILELISTtag constructs a list of the file names found in a folder. The created list contains the following columns:
FULLNAME Full path name of the file. NAME Name of the file. SIZE Size of the file. DIR Set totrueif the row is a folder, orfalseif the row is a file.The column values of the current row can be obtained using the syntax,
List.colnamewhereListis the name of the list andcolnameis the name of the column in the list.
Note
In the case of StringLists, the values can be obtained by using List.Item.
You can use the following attributes to return information about the list using the syntax,
List.attname, whereattnamecan be one of the following attributes:
#numRows Number of rows in this list#curRow Current row in this list.#moreRows Boolean (true/false) to indicate whether there are more rows following the current row.#numCols Number of columns in this list.@<colname> Only used on lists that contain resultsets. Contents of the file in the specified column if the colname begins with "url".For example,
MyList.#numRowsreturns the number of rows in the listMyList.MyList.@urlheaderretrieves the contents of the file specified by the column urlheader.The value of a list is maintained during the processing of a page request. If the list contains a resultset, the resultset is maintained independently of a list that uses it.
Error Numbers
The possible values of
errnoinclude:
Value Description -16 Empty list.Example
This example gets a list of all
*.htmlfiles found in the foldermydirand stores the results inmyfiles.<SETVAR NAME="errno" VALUE="0"/> <FILELIST NAME="myfiles" FILTER="*.html" RECURSIVE="true" PATH="c:mydir" /> <IF COND="Variables.errno=-16"> <THEN> No files found. </THEN> <ELSE> <LOOP> LIST="myfiles"> Full path: <CSVAR NAME="myfiles.FULLNAME"/> <br/> Filename: <CSVAR NAME="myfiles.NAME"/> <br/> Size: <CSVAR NAME="myfiles.SIZE"/> <br/> Dir is: <CSVAR NAME="myfiles.DIR"/> <br/> </LOOP> </ELSE> </IF>See Also
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.