aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2023-06-04 19:19:57 +0200
committerMartin Polden <mpolden@mpolden.no>2023-06-04 19:23:25 +0200
commit22c4502927634580bc87c96704def87b892882e2 (patch)
treedeacb69b781f33da2caaf56b8d4ac721a031859c
parent135f64474682f9984bb04a9aa4b7109af658aafe (diff)
watcher: handle renames
rsync copies to temporary files first, and then renames to the proper name.
-rw-r--r--watcher/watcher_linux.go2
-rw-r--r--watcher/watcher_notlinux.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/watcher/watcher_linux.go b/watcher/watcher_linux.go
index a3caa6b..6dd7917 100644
--- a/watcher/watcher_linux.go
+++ b/watcher/watcher_linux.go
@@ -5,4 +5,4 @@ package watcher
import "github.com/rjeczalik/notify"
// Watch IN_CLOSE_WRITE events on Linux to reduce the number of events to process
-const notifyFlag = notify.InCloseWrite
+const notifyFlag = notify.InCloseWrite | notify.InMovedTo
diff --git a/watcher/watcher_notlinux.go b/watcher/watcher_notlinux.go
index 6bdad95..efd7ea8 100644
--- a/watcher/watcher_notlinux.go
+++ b/watcher/watcher_notlinux.go
@@ -4,4 +4,4 @@ package watcher
import "github.com/rjeczalik/notify"
-const notifyFlag = notify.Write
+const notifyFlag = notify.Write | notify.Rename