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.
Post
Replies
Boosts
Views
Activity
I am using NetFS's NetFSMountURLAsync api to mount SMB share in mac os app. I am able to mount the share however this share is not automatically appearing in Finder's sidebar. I tried using LSSharedFileListInsertItemURL to make the mount point available in Finder's side bar however facing crash on line,
kLSSharedFileListItemBeforeFirst.takeRetainedValue()
from below code snippet.
let itemType: CFString = kLSSharedFileListFavoriteItems.takeRetainedValue()
if let list: LSSharedFileList = LSSharedFileListCreate(nil, itemType, nil)?.takeRetainedValue() {
let inPropertiesToSet: CFMutableDictionary = CFDictionaryCreateMutable(nil, 1, nil, nil)
CFDictionaryAddValue(inPropertiesToSet, unsafeBitCast(kLSSharedFileListVolumesNetworkVisible, to: UnsafeRawPointer.self), unsafeBitCast(kCFBooleanTrue, to: UnsafeRawPointer.self))
let driveUrl = URL(fileURLWithPath: mountPoint)
let shareUrl: CFURL = driveUrl as CFURL
if let item: LSSharedFileListItem = LSSharedFileListInsertItemURL(
list,
kLSSharedFileListItemBeforeFirst.takeRetainedValue(),
nil, iconRef, shareUrl, inPropertiesToSet, nil) {
let itemRefId = LSSharedFileListItemGetID(item)
let itemRefIdStr = "\(itemRefId)"
userDefaults.set(itemRefIdStr, forKey: mountPoint)
}
}
Anything wrong in above code? Also since this api is deprecated is there any alternative API to achieve this. The goal is to make the mount point available in Finder's sidebar so that user can easily access it.
We have QuickLook thumbnailing framework which is used to provide thumbnails for custom file types. However, how can we provide thumbnails for system defined file types for eg. image file types?
Is there any way to achieve this?
I want to provide my own thumbnails for the file types which System already provides thumbnails for. I tried using QLThumbnailProvider however it works only when the file type is custom. For system supported file types it doesn't allow me to override my own thumbnails. Is there any alternative to this?
Default behaviour of the macOS when interacting via Finder with a network share is to create thumbnails to provide a nice user experience. This behaviour is implemented by QuickLook framework.
This triggers the full file download and quickly lead to cache using large disk space and even cache trashing.
We can disable QuickLook selectively by injecting specially prepared .DS_Store file with instruction/setup to disable thumbnails in that directory but still degrades user's experience only in the network share ecosystem.
Is there any way we can provide our own thumbnails or ask Finder to not download full file to generate the thumbnail?