--- a/scan.lua Sat Sep 12 21:27:57 2009 +0300 +++ b/scan.lua Sun Sep 13 22:22:47 2009 +0300 @@ -24,7 +24,7 @@ local a=lfs.attributes(n) if a.mode=='directory' then local nh=scan(n) - h[n]=nh + h[f]=nh elseif a.mode=='file' then h[f]=true end @@ -42,9 +42,13 @@ end end -function map(h, g) +function map(h, g, d) local function dir(prefix, name) - return path.join(prefix, name) + local p=path.join(prefix, name) + if d then + d(p) + end + return p end local function file(prefix, name)