• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Trying to understand a permissions failure when writing to ~/Desktop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trying to understand a permissions failure when writing to ~/Desktop


  • Subject: Re: Trying to understand a permissions failure when writing to ~/Desktop
  • From: Roland King <email@hidden>
  • Date: Thu, 28 Jan 2016 10:54:00 +0800

From the original mail

"Note this isn’t a sandboxed app, so that shouldn’t come into it.”


> On 28 Jan 2016, at 10:51, Alex Zavatone <email@hidden> wrote:
>
> According to the sandboxing docs, I recall that for sandboxing, there are a certain set of locations where you can save files to without requiring user permission.  Your ~/Documents folder is one of them. IIRC, all other locations require user confirmation to save the files.
>
> Try saving to the docs folder and/or trying writing to the desktop with sandboxing disabled.
>
> On Jan 27, 2016, at 8:42 PM, Graham Cox <email@hidden> wrote:
>
>> I use -[NSData writeToURL:options:error] to write data to files in a location generally chosen by the user. That works fine.
>>
>> The default location is ~/Desktop, if the user fails to choose anything, or if the bookmark of the previously chosen location fails to resolve. However, when I try to write the file I get an error 513, ‘you don’t have permission’, underlying error 1, operation not permitted’. If the user chooses the Desktop themselves using the Open panel, it works fine.
>>
>> The ~/Desktop permissions seem to be OK - I have readwrite permission on that folder.
>>
>> So something is weird about the URL for ~/Desktop when I create it programatically as opposed to what NSOpenPanel returns. Note this isn’t a sandboxed app, so that shouldn’t come into it.
>>
>> I create the default URL thusly:
>>
>> 			NSURL* desktopURL = [[NSFileManager defaultManager] URLForDirectory:NSDesktopDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:&error];
>>
>>
>> I can’t see any obvious difference between the URL here and the one I get from NSOpenPanel, but there must be one.
>>
>>
>> Any ideas what the problem could be here?
>>
>> —Graham
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>>
>> 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
>
>
> _______________________________________________
>
> 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

_______________________________________________

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


  • Follow-Ups:
    • Re: Trying to understand a permissions failure when writing to ~/Desktop
      • From: Alex Zavatone <email@hidden>
References: 
 >Trying to understand a permissions failure when writing to ~/Desktop (From: Graham Cox <email@hidden>)
 >Re: Trying to understand a permissions failure when writing to ~/Desktop (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: Trying to understand a permissions failure when writing to ~/Desktop
  • Next by Date: Re: Trying to understand a permissions failure when writing to ~/Desktop
  • Previous by thread: Re: Trying to understand a permissions failure when writing to ~/Desktop
  • Next by thread: Re: Trying to understand a permissions failure when writing to ~/Desktop
  • Index(es):
    • Date
    • Thread