mirror of
https://github.com/octoleo/lsyncd.git
synced 2025-01-06 08:40:44 +00:00
fixing fsevents
This commit is contained in:
parent
52ebb96641
commit
774f99bc21
13
fsevents.c
13
fsevents.c
@ -217,8 +217,11 @@ handle_event(lua_State *L, struct kfs_event *event, ssize_t mlen)
|
||||
break;
|
||||
case FSE_ARG_MODE :
|
||||
switch(atype) {
|
||||
case FSE_CHOWN :
|
||||
case FSE_RENAME :
|
||||
case FSE_CHOWN :
|
||||
case FSE_CONTENT_MODIFIED :
|
||||
case FSE_CREATE_FILE :
|
||||
case FSE_CREATE_DIR :
|
||||
case FSE_DELETE :
|
||||
case FSE_STAT_CHANGED :
|
||||
isdir = arg->data.mode & S_IFDIR ? 1 : 0;
|
||||
@ -239,23 +242,17 @@ handle_event(lua_State *L, struct kfs_event *event, ssize_t mlen)
|
||||
etype = "Attrib";
|
||||
break;
|
||||
case FSE_CREATE_DIR :
|
||||
etype = "Create";
|
||||
isdir = 1;
|
||||
break;
|
||||
case FSE_CREATE_FILE :
|
||||
etype = "Create";
|
||||
isdir = 0;
|
||||
break;
|
||||
case FSE_DELETE :
|
||||
etype = "Delete";
|
||||
isdir = 0;
|
||||
break;
|
||||
case FSE_RENAME :
|
||||
etype = "Move";
|
||||
break;
|
||||
case FSE_CONTENT_MODIFIED :
|
||||
etype = "Modify";
|
||||
isdir = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -276,7 +273,7 @@ handle_event(lua_State *L, struct kfs_event *event, ssize_t mlen)
|
||||
l_now(L);
|
||||
lua_pushstring(L, path);
|
||||
if (trg) {
|
||||
lua_pushstring(L, path);
|
||||
lua_pushstring(L, trg);
|
||||
} else {
|
||||
lua_pushnil(L);
|
||||
}
|
||||
|
@ -1904,7 +1904,16 @@ local Fsevents = (function()
|
||||
-- @param filename2
|
||||
--
|
||||
local function event(etype, isdir, time, path, path2)
|
||||
|
||||
if isdir then
|
||||
path = path .. '/'
|
||||
if path2 then
|
||||
path2 = path2 .. '/'
|
||||
end
|
||||
end
|
||||
|
||||
log("Fsevents",etype,",",isdir,",",time,",",path,",",path2)
|
||||
|
||||
for _, s in Syncs.iwalk() do repeat
|
||||
local root = s.source
|
||||
if not path:starts(root) then
|
||||
|
@ -11,7 +11,7 @@ local tdir, srcdir, trgdir = mktemps()
|
||||
churn(srcdir, 10)
|
||||
|
||||
local logs = {}
|
||||
logs = {"-log", "Delay" }
|
||||
--logs = {"-log", "Delay", "-log", "Fsevents" }
|
||||
local pid = spawn("./lsyncd", "-nodaemon", "-delay", "5",
|
||||
"-rsync", srcdir, trgdir, unpack(logs))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user