
Description
Pseudo function
Directory information can be accessed by considering as a virtual table
File is considered as row, and name, size, data updated, time updated, and attribute of the file are considered as column. Column name is NAME, SIZE, DATE, TIME, and ATTR respectively.
The DATE is returned as a string with the format YYYYMMDD
The TIME is returned as a string with the format HHMMSS
In the ATTR column, it returns the letter 'd' indicating a directory, or returns string with length 0

Syntax
ret = directory(dirname)

Parameters

Return Value
| 0 | : | Success | |
| 10 | : | Argument error | |

System Return Value

Example
//[result example]
//
// c:testdir/. : file size is 0, last modified time is 20031120
// c:testdir/.. : file size is 0, last modified time is 20031120
// c:testdir/sample1.txt : file size is 410, last modified time is 20031101
// c:testdir/sample2.txt : file size is 1230, last modified time is 20031108
// c:testdir/sample3.txt : file size is 37720, last modified time is 20031115
//
run()
exit
function run()
local dirname = 'c:testdir'
local tab
local i
xsql select NAME, SIZE, DATE from directory('${dirname}', 'NAME', 'SIZE', 'DATE');
tab = xfetch(0)
xclose()
loop i=0;i<count(tab); i++
print('${dirname}/${tab[i]["NAME"]} : file size is ${tab[i]["SIZE"]}, last modified time is ${tab[i]["DATE"]}', stdout)
endloop
endfunction