Hello

I am writing a simple Mail.app plugin that is intended for exporting
emails in a custom format.
Now, the problem is that I used to save email files into a temporary
directory (NSTempDirectory()) before converting them.
It worked fine on 10.6 and 10.7, but on OS X 10.8, everytime I try to
write anything from within a Mail.app plugin (plugins operate on
behalf of Mail.app itself) to /private/var/tmp I am getting a "You do
not have permissions" error. I suppose this is because Mail on
Mountain Lion became sandboxed.

I thought I found a solution to write to /tmp, using this  function:
NSString *TempDir = [[[NSFileManager defaultManager]
URLForDirectory:NSItemReplacementDirectory inDomain:NSUserDomainMask
appropriateForURL:[NSURL
URLWithString:@"file:///private/var/tmp/mytempdir"] create:YES
error:nil] path];

but everytime i try to write to TempDir, i still get this "No
permission" error. Even though the directory, whose path is in TempDir
(/private/var/folders/68/qm5hjswj1gjc5_5ngpdjkh8c0000gn/T/com.apple.mail/TemporaryItems/(A
Document Being Saved By Mail)) is allowed for writing for an ordinary
user.

Why can't I write there programmatically then?..

Thanks!
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to