dir->eachPathRecursive
dir->eachPathRecursive is a member in the dir Object group; call it on the receiver shown before the arrow.
Target
Signature
1dir->eachPathRecursivedir->eachPathRecursive is a member in the dir Object group; call it on the receiver shown before the arrow.
dir->eachPathRecursive is called with member syntax on a receiver value. dir->eachPathRecursive touches paths or filesystem data. Resolve paths deliberately and avoid mixing visitor-provided path fragments with trusted server paths without validation.
In web-serving modes, request-targeted application file access cannot escape the configured document_root. That boundary can come from the .ini file, the --docroot flag used by the LaiRu HTTP server or FPM process, or FastCGI values such as DOCUMENT_ROOT and SCRIPT_FILENAME supplied by nginx or Apache. See the web root directory, FastCGI options, and LaiRu FPM pages for the deployment side of that boundary.
Examples
Basic call
1dir->eachPathRecursiveList files beneath a configured directory
1[2local(root) = dir('/var/www/html/assets')3if(#root->exists) => {4 #root->eachFilePath => {5 local(f) = file(#1)6 #f->path + ' ' + #f->size + '\n'7 }8}9]Recursive traversal with an explicit base
1[2local(base) = '/var/www/html/content'3dir(#base)->eachPathRecursive => {4 local(path) = string(#1)5 if(not #path->contains('/.')) => {6 #path + '\n'7 }8}9]