diff --git a/apps/ios/Sources/Camera/CameraController.swift b/apps/ios/Sources/Camera/CameraController.swift index e361664cf..b33f40a00 100644 --- a/apps/ios/Sources/Camera/CameraController.swift +++ b/apps/ios/Sources/Camera/CameraController.swift @@ -160,14 +160,14 @@ actor CameraController { defer { session.stopRunning() } await Self.warmUpCaptureSession() - let movURL = FileManager.default.temporaryDirectory + let movURL = FileManager().temporaryDirectory .appendingPathComponent("clawdbot-camera-\(UUID().uuidString).mov") - let mp4URL = FileManager.default.temporaryDirectory + let mp4URL = FileManager().temporaryDirectory .appendingPathComponent("clawdbot-camera-\(UUID().uuidString).mp4") defer { - try? FileManager.default.removeItem(at: movURL) - try? FileManager.default.removeItem(at: mp4URL) + try? FileManager().removeItem(at: movURL) + try? FileManager().removeItem(at: mp4URL) } var delegate: MovieFileDelegate? diff --git a/apps/ios/Sources/Model/NodeAppModel.swift b/apps/ios/Sources/Model/NodeAppModel.swift index e788d5db8..2830f17d7 100644 --- a/apps/ios/Sources/Model/NodeAppModel.swift +++ b/apps/ios/Sources/Model/NodeAppModel.swift @@ -837,7 +837,7 @@ final class NodeAppModel { fps: params.fps, includeAudio: params.includeAudio, outPath: nil) - defer { try? FileManager.default.removeItem(atPath: path) } + defer { try? FileManager().removeItem(atPath: path) } let data = try Data(contentsOf: URL(fileURLWithPath: path)) struct Payload: Codable { var format: String diff --git a/apps/ios/Sources/Screen/ScreenRecordService.swift b/apps/ios/Sources/Screen/ScreenRecordService.swift index e31762e51..6bccae5f9 100644 --- a/apps/ios/Sources/Screen/ScreenRecordService.swift +++ b/apps/ios/Sources/Screen/ScreenRecordService.swift @@ -91,7 +91,7 @@ final class ScreenRecordService: @unchecked Sendable { let includeAudio = includeAudio ?? true let outURL = self.makeOutputURL(outPath: outPath) - try? FileManager.default.removeItem(at: outURL) + try? FileManager().removeItem(at: outURL) return RecordConfig( durationMs: durationMs, @@ -104,7 +104,7 @@ final class ScreenRecordService: @unchecked Sendable { if let outPath, !outPath.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty { return URL(fileURLWithPath: outPath) } - return FileManager.default.temporaryDirectory + return FileManager().temporaryDirectory .appendingPathComponent("clawdbot-screen-record-\(UUID().uuidString).mp4") } diff --git a/apps/shared/ClawdbotKit/Sources/ClawdbotKit/StoragePaths.swift b/apps/shared/ClawdbotKit/Sources/ClawdbotKit/StoragePaths.swift index bcea1aaab..b785efee7 100644 --- a/apps/shared/ClawdbotKit/Sources/ClawdbotKit/StoragePaths.swift +++ b/apps/shared/ClawdbotKit/Sources/ClawdbotKit/StoragePaths.swift @@ -2,7 +2,7 @@ import Foundation public enum ClawdbotNodeStorage { public static func appSupportDir() throws -> URL { - let base = FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask).first + let base = FileManager().urls(for: .applicationSupportDirectory, in: .userDomainMask).first guard let base else { throw NSError(domain: "ClawdbotNodeStorage", code: 1, userInfo: [ NSLocalizedDescriptionKey: "Application Support directory unavailable", @@ -19,7 +19,7 @@ public enum ClawdbotNodeStorage { } public static func cachesDir() throws -> URL { - let base = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first + let base = FileManager().urls(for: .cachesDirectory, in: .userDomainMask).first guard let base else { throw NSError(domain: "ClawdbotNodeStorage", code: 2, userInfo: [ NSLocalizedDescriptionKey: "Caches directory unavailable",