upgrade(_:cacheMode:context:replyHandler:)
Upgrades the item cache mode to a less restrictive level, allowing more caching.
Declaration
func upgrade(_ item: FSItem, cacheMode: FSVolume.DataCacheMode, context: FSContext, replyHandler reply: @escaping @Sendable (FSUpgradeItemResult?, (any Error)?) -> Void)func upgrade(_ item: FSItem, cacheMode: FSVolume.DataCacheMode, context: FSContext) async throws -> FSUpgradeItemResultParameters
- item:
The item for which to upgrade the cache mode.
- cacheMode:
The new (more permissive) cache mode being requested.
- context:
An object that enables context-aware file system decisions throughout the operation.
Discussion
::::: Swift ::::::::::
reply: A block or closure to indicate success or failure. If successful, pass an instance of FSUpgradeItemResult containing the granted FSVolume.KernelCacheCoherencyType, along with a
nilerror. If upgrading fails, pass the relevant error as the second parameter; FSKit ignores the FSUpgradeItemResult instance in this case. For anasyncSwift implementation, there’s no reply handler; simply return the result instance or throw an error.
::::::::::::::::::::
::::: ObjC ::::::::::
result: A block or closure to indicate success or failure. If successful, pass an instance of FSUpgradeItemResult containing the granted FSVolume.KernelCacheCoherencyType, along with a
nilerror. If upgrading fails, pass the relevant error as the second parameter; FSKit ignores the FSUpgradeItemResult instance in this case. For anasyncSwift implementation, there’s no reply handler; simply return the result instance or throw an error.
::::::::::::::::::::
Discussion
FSKit calls this method when transitioning to a cache mode that allows more aggressive caching.