The [dir->eachFile] method returns a list of [file] objects that reference the files immediately contained in the directory that the original [dir] object represents.
local(d) = dir(...)
#d->eachFile
The code below outputs the file name for each file in the web-root. For purposes of the result, assume that the web-root contains the following files: 'index.lasso' and 'test.lasso'.
Code
local(web_root) = dir('/')
with f in #web_root->eachFile
do {^
'<p>' + #f->name + '</p>'
^}
Result
index.lasso
test.lasso
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Recent Comments