Re: Sandbox, security bookmarks and trash
Re: Sandbox, security bookmarks and trash
- Subject: Re: Sandbox, security bookmarks and trash
- From: Simone Tellini <email@hidden>
- Date: Mon, 29 Oct 2012 13:27:18 +0100
Il giorno 29/ott/2012, alle ore 12:55, Mike Abdullah <email@hidden> ha scritto:
>> Problem is, if the user moves one of those files to the trash, the next time the application resolves the security bookmark it will point to the deleted file (ie. something like ".../.Trash/..."). I'd rather like the application to keep on re-creating the file at the path the user has chosen in the first place (ie. "~/Documents/exporteddata.xml").
>>
>> Is it possible? Or how do you handle this scenario in an user-friendly way?
>
> You're up against the design of bookmarks here.
yeah, I was afraid about that. I just hoped I missed something hidden very well in the docs ;-)
> There's also an option to create a "minimal" bookmark. The docs don't say what's different about that. Have you tried it at all?
>
yes, it doesn't work. I haven't tried it with a local filesystem, but trying to create a minimal bookmark on a smb network share won't work. The docs say that a minimal bookmark only allows fewer resolution methods...
Another problem with the bookmarks is, you need to have a file to create one. So if the user deletes the file, the bookmark is invalid anyway. I've filed a radar suggesting they add an option to bookmarkDataWithOptions:...error: to handle this case, I'm not much hopeful about them implementing it though.
> In a non-sandboxed app, the proper solution would be to instead create a bookmark to the folder for exporting to (e.g. ~/Documents/). You could add in a custom property to the bookmark of the filename to export to.
when the app was not sandboxed, it simply kept the file paths ;-) After all, if the user set those paths in the document, he expected to find exported data at those locations until he changed them (other applications might consume those files and they might not even run on a Mac).
--
Simone Tellini
http://tellini.info
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden