Hi all, i am trying to implement File Provider Extension. I was able to enumerate remote storage directories to local via 'enumerateItems' function of NSFileProviderEnumerator.
I can apply remote storage changes like newly created files/folders, move, rename and delete operations and successfully apply them to local with 'NSFileProviderChangeObserver' class 'didUpdate' and 'didDeleteItems' functions.
However when file content is updated on remote server;
- If file content is not fetched(file is Dataless), i can not apply this change to local. When i call 'NSFileProviderChangeObserver' class 'didUpdate' function for changed file, only DateModified attribute is updated on finder, file size is not changed to new size.
- If file content has been fetched, When i call 'NSFileProviderChangeObserver' class 'didUpdate' function nothing is changed, file content stay depreciated
Any suggestion how to fix it?
When the item content is changed remotely, you should signal the working set, and enumerate an NSFileProviderItem on the working set with a different -[NSFileProviderItem itemVersion]
, changing the contentVersion
to a different value than before.
The behaviors regarding remote file content updates are also influenced by the -[NSFileProviderItem contentPolicy]
.
Regarding your first point, are you changing the documentSize
on the item when you enumerate the updated item metadata on the working set?