scan.lua

changeset 3
b2df1b3f2c83
parent 2
3975fa5ed630
child 7
038275cd92ed
--- 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)

mercurial