Implement watching a path

Each inotify instance produces events for paths in its watch list. Each
item in the watch list is identified by its watch descriptor. Different
paths can be watched for different events.
This commit is contained in:
T. R. Bernstein
2026-03-11 17:58:06 +01:00
parent 098339f9d1
commit 564c409c15
5 changed files with 92 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
import Foundation
func withTempDir(_ body: (String) async throws -> Void) async throws {
let dir = FileManager.default.temporaryDirectory
.appendingPathComponent("InotifyIntegrationTests-\(UUID().uuidString)")
.path
try FileManager.default.createDirectory(atPath: dir, withIntermediateDirectories: true)
defer { try? FileManager.default.removeItem(atPath: dir) }
try await body(dir)
}