I have applied content policy as "downloadEagerlyAndKeepDownloaded" on the folder which i want to materialise (want to implement windows similar feature Always keep on this device feature in mac os in FileProvider). For root item the policy is downloadLazily and for rest of the item it is inherited. The issue i am facing is, while dematerialising the folder, the file provider'e evictItem api is continuously failing with resource busy error though there is no file from that folder in an open state. And it keeps giving the same error and unable to dematerialise that folder.
FileProvider's eviction is failing with resource busy error though no file is open
Using the contentPolicy downloadEagerlyAndKeepDownloaded
will not allow the file to be evicted. If you need a file to be downloaded once, but be evictable later, you can use this method to request a one-off download, and set one of the other contentPolicy options which allow for eviction. https://developer.apple.com/documentation/fileprovider/nsfileprovidermanager/3991535-requestdownloadforitemwithidenti?language=objc