parser

Написать ответ на текущее сообщение

 

 
   команды управления поиском

Ответ

Janek 05.05.2010 15:05 / 05.05.2010 15:15

да - я теперь вспомнил про себя что ваш метод не работает рекурсивно.
но когда-нибудь он был для меня вдохновлением чтоб сделать тот же самое рекурсивно:
###################################################################################################
#loads directory tree into hash
#inspired by @loadDirectoryData[] misha's from AutoIndex class
#http://www.parser.ru/examples/autoindex/
@_loadDirectoryTree[sDir;hExclude][locals]
$result[^hash::create[]]
$tList[^file:list[$sDir]]
$tDirectories[^table::create{name}]
$tList[^tList.select(-d "${sDir}$tList.name/")]
$tList[^tList.select(!$hExclude.[^pfString:right[${sDir}$tList.name/;$self.options.rootDir]])]
^tList.menu{
	$thisDir[${sDir}$tList.name]
	^if(-d $thisDir){
		^tDirectories.append{$thisDir}
	}
}
^tDirectories.menu{
	$result.[$tDirectories.name/][
		^if(^tDirectories.count[] > 0){
			^_loadDirectoryTree[$tDirectories.name/;$hExclude]
		}
	]
}