NSFileProviderReplicatedExtension copy hooks?

My company has developed a desktop-Mac FileProvider extension which presents a user with shared encrypted folders; it's working well except for one issue. While we can handle moving an encrypted folder, there seems to be no way to detect that an encrypted folder has been copied or duplicated.

Is there any equivalent to the Windows shell extension copy-hook handler, which can allow NSReplicatedFileProviderExtension (or some other portion of the system) to detect that a folder is being copied?

Answered by DTS Engineer in 789616022

If you are looking for a way to tell whether item A is a copy of item B in your file provider extension to avoid data duplication on your server, the system doesn't provide any support. I suggest that you file a feedback report for the file provider folks to consider.

Folks typically implement a checksumming or chunking mechanism for that purpose, but I am not sure if that is possible in your case, given that you are using encrypted storage. You need to implement your own mechanism any way.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

I would suggest looking into the header file for NSFileProviderUserInteractions. It provides the following hooks:

'Copy'       : copying item(s) within the same provider 'CopyOut'    : copying item(s) out of the provider
'CopyIn'     : copying item(s) into a folder/root of the provider

You can access these hooks via the info.plist of you File Provider Extension. The header file provides an example of this.

I have personally used it to display an alert when preventing forbidden user actions. I expect you could also use it to call custom functions.

Hope this helps :)

If you are looking for a way to tell whether item A is a copy of item B in your file provider extension to avoid data duplication on your server, the system doesn't provide any support. I suggest that you file a feedback report for the file provider folks to consider.

Folks typically implement a checksumming or chunking mechanism for that purpose, but I am not sure if that is possible in your case, given that you are using encrypted storage. You need to implement your own mechanism any way.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

NSFileProviderReplicatedExtension copy hooks?
 
 
Q