Link | jc_eachVisibleFilePathRecursive |
Author | Jolle Carlestam |
Category | File |
Version | 9.x |
License | Public Domain |
Posted | 12 Sep 2012 |
Updated | 12 Sep 2012 |
More by this author... |
Methods adding to the dir type that will allow dealing with only visible files or directories.
The built in method dir -> eachFilePathRecursive returns all files and directories found in the given path. Using dir -> eachVisibleFilePathRecursive will only return visible files and directories. Very useful if you for example want to get a listing without possible SVN directories in the path.
local(tree = dir('/mypath/morepath/') -> jc_eachVisibleFilePathRecursive) -> /_mypath/morepath/myfile.lasso, /_mypath/morepath/myimages/myimage.jpg
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
jc_eachVisibleFilePath() => { return with name in self->eachEntry where #name->second != io_dir_dt_dir where not(#name->first -> beginswith('.')) select .makeFullPath(#name->first) } define dir -> jc_eachVisibleDir() => { return with name in self->eachEntry where #name->second == io_dir_dt_dir where not(#name->first -> beginswith('.')) select dir(.makeFullPath(#name->first + '/')) } define dir -> jc_eachVisibleFilePathRecursive(-dirFilter = void) => { local(files = .jc_eachVisibleFilePath) with dir in .jc_eachVisibleDir where !#dirFilter || #dirFilter(#dir->realPath) do { #files = tie(#files, #dir->jc_eachVisibleFilePathRecursive(-dirFilter=#dirFilter)) } return #files } ?>
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft