deactivateItem(_:context:replyHandler:)
Notifies the file system that the kernel is no longer making immediate use of the given item.
Declaration
func deactivateItem(_ item: FSItem, context: FSContext, replyHandler reply: @escaping @Sendable (FSDeactivateItemResult?, (any Error)?) -> Void)func deactivateItem(_ item: FSItem, context: FSContext) async throws -> FSDeactivateItemResultParameters
- item:
The item to deactivate.
- context:
An object that enables context-aware file system decisions throughout the operation.
- reply:
A block or closure to indicate success or failure. If deactivation succeeds, pass an instance of Fsdeactivateitemresult containing the volume’s updated free space, along with a
nilerror. If deactivation fails, pass the relevant error as the second parameter; FSKit ignores the Fsdeactivateitemresult instance in this case. For anasyncSwift implementation, there’s no reply handler; simply return the result instance or throw an error.
Discussion
This method gives a file system a chance to release resources associated with an item. However, this method prescribes no specific action; it’s acceptable to defer all reclamation until reclaimItem(_:replyHandler:). This method is the equivalent of VFS’s VNOP_INACTIVE.
FSKit restricts calls to this method based on the current value of itemDeactivationPolicy.