notes:
path: full path string (max length of MAX_PATH - 260), you cannot watch the same path!
subtree: track changes to child directories as well
filterFlags: pass "folder" to watch changes to files/folders (creation/deletion of directories/files,*renaming is deleting and then creating)
otherwise default is watch only files (create/delete/write events)
for more information refer to: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findfirstchangenotificationa
*this class cannot pass what files or kind of changes has occured, to the callback function.
-- example script....
local myPath = "C:\\MyPath\\"
local onMyPathChange = function()
print('A change occured to the path:',myPath); -- when a file
end
myPathWatchHandle = watchDirectory.add(myPath,onMyPathChange,false,"folder")
-- remove watch notification from directory
-- watchDirectory.remove(myPathWatchHandle);
--]]
watch_directory.lua
Description:
03/01/2021 -- fixed some typo and multiple directories bug
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum