Post

Replies

Boosts

Views

Activity

Reply to Storing metadata alongside files outside of sandbox
Hi Etresoft, I'm not really sure what you mean by the "do you need these metadata files or do your users?" question - the metadata files store any comments or other annotations made by the user. If there is no way to make the <allowed file>.rehex-meta filenames accessible from within the sandbox, I could instead store the metadata within the application sandbox and provide import/export functionality, but I don't like this approach since the metadata is then hidden away rather than in a visible/easily copied place along with the file they are working on. Additionally, if the user moves/deletes the file, then the metadata within the application sandbox would become detached.
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’25
Reply to Storing metadata alongside files outside of sandbox
Hi Quinn, Thanks for the detailed response. I've done a bit of testing with the related files mechanism and can confirm that when I expose a "rehex-foo" and "rehex-meta" file type, I am able to write a foo.rehex-meta file when writing a foo.rehex-foo file using NSFileCoordinator, however I have not been able to get it to work in any other cases - even foo.rehex-foo.rehex-meta is not allowed when writing a foo.rehex-foo file. The NSFileCoordinator.coordinateWritingItemAtURL() method invokes my callback even in the cases that won't work, with the original path which it still doesn't allow access to. For reference, here are the relevant sections of the Info.plist I tested with: <key>UTExportedTypeDeclarations</key> <array> <dict> <key>UTTypeIdentifier</key> <string>net.solemnwarning.rehex-meta</string> <key>UTTypeConformsTo</key> <array> <string>public.json</string> </array> <key>UTTypeDescription</key> <string>Metadata of a file opened in REHex</string> <key>UTTypeTagSpecification</key> <dict> <key>public.filename-extension</key> <array> <string>rehex-meta</string> </array> </dict> </dict> <dict> <key>UTTypeIdentifier</key> <string>net.solemnwarning.rehex-foo</string> <key>UTTypeDescription</key> <string>Test file</string> <key>UTTypeTagSpecification</key> <dict> <key>public.filename-extension</key> <array> <string>rehex-foo</string> </array> </dict> </dict> </array> <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>LSHandlerRank</key> <string>Default</string> <key>LSItemContentTypes</key> <array> <string>net.solemnwarning.rehex-foo</string> </array> </dict> <dict> <key>NSIsRelatedItemType</key> <true/> <key>CFBundleTypeRole</key> <string>Editor</string> <key>LSHandlerRank</key> <string>Owner</string> <key>LSItemContentTypes</key> <array> <string>net.solemnwarning.rehex-meta</string> </array> </dict> </array>
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’25