diff --git a/lsyncd.lua b/lsyncd.lua index 73df7d0..41c2eaf 100644 --- a/lsyncd.lua +++ b/lsyncd.lua @@ -1590,17 +1590,28 @@ local Inotifies = (function() -- looks up the watch descriptor id local path = wdpaths[wd] + if path then + path = path..filename + end + + local path2 = wd2 and wdpaths[wd2] + if path2 and filename2 then + path2 = path2..filename2 + end + + if not path and path2 and etype =="Move" then + log("Inotify", "Move from deleted directory ",path2, + " becomes Create.") + path = path2 + path2 = nil + etype = "Create" + end + if not path then -- this is normal in case of deleted subdirs log("Inotify", "event belongs to unknown watch descriptor.") return end - path = path..filename - - local path2 = wd2 and wdpaths[wd2] - if path2 and filename2 then - path2 = path2..filename2 - end for sync, root in pairs(syncRoots) do repeat local relative = splitPath(path, root)