Implement async event streaming
This commit is contained in:
10
Tests/InotifyIntegrationTests/Utilities/withTempDir.swift
Normal file
10
Tests/InotifyIntegrationTests/Utilities/withTempDir.swift
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user