Watch directories moved into the tree and report their content

Automatic subtree watching only reacted to `CREATE`, so a directory
moved in from elsewhere stayed unwatched. It is now handled like a
created one. Items that already exist in such a directory never
produce kernel events; they are reported with the same event kind
and `synthesized` set to `true`, so consumers can treat them as
newly appeared.
This commit is contained in:
T. R. Bernstein
2026-09-13 23:13:32 +02:00
parent e6ed232087
commit 134034f3ea
8 changed files with 101 additions and 11 deletions
+2 -1
View File
@@ -31,7 +31,8 @@ struct InotifyEventParser {
watchDescriptor: rawEvent.wd,
mask: InotifyEventMask(rawValue: rawEvent.mask),
cookie: rawEvent.cookie,
name: Self.extractName(from: eventPointer, nameLength: rawEvent.len)
name: Self.extractName(from: eventPointer, nameLength: rawEvent.len),
synthesized: false
))
offset += Self.eventSize(nameLength: rawEvent.len)