def findR(path, pattern=NULL){
t = files(path)
if (isValid(pattern)){
t = files(path, pattern)
}
res = select * from t where !isDir
update res set res.filename = path +"/" + res.filename
for (f in select * from files(path) where !!isDir){
try {
subRes = findR(path+"/"+f.filename, pattern)
res.append!(subRes)
} catch(ex){
print("ex:"+path+"/"+f.filename+ string(f.isDir))
}
}
return res
}
1条答案
按热度按时间eanckbw91#
您可以像这样定义函数:
例如:
输出: