Fixed dirwatch dummy, and scanning.

This commit is contained in:
Adam Harrison
2022-05-09 21:30:13 -04:00
parent d8436d1e92
commit ddc3a8842b
2 changed files with 8 additions and 7 deletions
+3 -2
View File
@@ -97,8 +97,9 @@ function dirwatch:check(change_callback, scan_time, wait_time)
local start_time = system.get_time()
for directory, old_modified in pairs(self.scanned) do
if old_modified then
local new_modified = system.get_file_info(directory).modified
if old_modified < new_modified then
local info = system.get_file_info(directory)
local new_modified = info and info.modified
if old_modified ~= new_modified then
change_callback(directory)
had_change = true
self.scanned[directory] = new_modified