A plugin for a sandboxed app - where to can I successfully store a temp file?
A plugin for a sandboxed app - where to can I successfully store a temp file?
- Subject: A plugin for a sandboxed app - where to can I successfully store a temp file?
- From: Nick <email@hidden>
- Date: Fri, 22 Feb 2013 03:34:39 +0200
Hello.
I am working on a plugin for Mail.app for Mountain Lion. The problem is
whenever I try to save a file, I am getting an error. Which can be
explained by the fact that Mail.app is sandboxed and I am not allowed to
modify files anywhere on the system.
So what I do instead - is call
TempDir = [[[NSFileManager defaultManager] URLForDirectory:
NSDownloadsDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:
YES error:nil] path];
and then create in this TempDir another directory using standard
NSFileManager functions.
On my Mail.app it works, on another system - it doesn't (the dir doesn't
get created). I can't understand why. I was hoping to store a temporary
file in Downloads, since Mail obviously should have access to this
directory.
I also tried calling this
TempDir = [[[[NSFileManager defaultManager]
URLForDirectory:NSItemReplacementDirectory inDomain:NSUserDomainMask
appropriateForURL:[NSURL URLWithString:
@"file:///private/var/tmp/my.great.app"] create:YES error:nil] path]
retain];
On my 10.8 system it works, on another - it doesn't (I can't save files to
TempDir from my plugin). What am I doing wrong?
And why on one 10.8 system this method works, and on another 10.8 it
doesn't?
This is a plugin (a bundle with an executable) for Mail.app.
Thanks for any insights!
_______________________________________________
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