The [dir->eachDir]
method returns a list of [dir]
objects that reference the directories contained in the directory that the original [dir]
object represents. The return type is a [queriable_select]
which allows you to work with it in query expressions.
local(d) = dir(...)
#d->eachDir
The following code will display each directory path in the web-root and the number of files and directories they contain. For purposes of this example, assume that the web-root has the following directories: 'css', 'img', and 'js' each containing 2 files and 1 directory.
Code
local(web_root) = dir('/')
with d in #web_root->eachDir
do {^
'<p>' + #d->path + ' -- ' + #d->size + '</p>'
^}
Result
/css/ -- 3
/img/ -- 3
/js/ -- 3
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