Re: How to tell if a file is writable in sandboxed mode?

2013-11-13 Thread Oleg Krupnov
Thanks for new info, but no, unfortunately, this NSURLIsWritableKey cannot discriminate between not writable due to file permissions” and “not writable due to sandbox” cases. The both cases are not writable for the NSURLIsWritableKey. I’ve found another workaround but not sure how reliable it is,

Re: How to tell if a file is writable in sandboxed mode?

2013-11-13 Thread Mike Abdullah
On 13 Nov 2013, at 11:46, Oleg Krupnov oleg.krup...@gmail.com wrote: Thanks for new info, but no, unfortunately, this NSURLIsWritableKey cannot discriminate between not writable due to file permissions” and “not writable due to sandbox” cases. The both cases are not writable for the

Re: How to tell if a file is writable in sandboxed mode?

2013-11-13 Thread Oleg Krupnov
I am not sure what you mean by the failure, could you explain please? In my experience, if you have read-write sandbox access to a url, you can create bookmark with and without the NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess flag, and it will create different NSData objects. And if you

Re: How to tell if a file is writable in sandboxed mode?

2013-11-13 Thread Kyle Sluder
On Nov 13, 2013, at 10:19 PM, Oleg Krupnov oleg.krup...@gmail.com wrote: And as always, my design is asked to be reconsidered. No one wants to reconsider design of the sandbox itself, that *IS* creating so much pain in the ass for everyone :) Because we can't change the sandbox by discussing

Re: How to tell if a file is writable in sandboxed mode?

2013-11-09 Thread Mike Abdullah
Does querying for NSURLIsWritableKey give you any more info? On 8 Nov 2013, at 16:31, Oleg Krupnov oleg.krup...@gmail.com wrote: I’m trying to use -[NSFileManager isWritableFileAtPath:], but when it returns NO, I’d like to know if it’s “no” because the app simply doesn’t have access to this

Re: How to tell if a file is writable in sandboxed mode?

2013-11-09 Thread Dong Feng
I wonder whether you want to do this in the first place. I had tried the same thing on Windows, that is, checking write permission upfront. I ended up with just writing and letting it fail if the permission was not granted. Windows permission rules are very complicated and API is quite unfriendly.

How to tell if a file is writable in sandboxed mode?

2013-11-08 Thread Oleg Krupnov
I’m trying to use -[NSFileManager isWritableFileAtPath:], but when it returns NO, I’d like to know if it’s “no” because the app simply doesn’t have access to this path due to sandboxing, or is it “no because the file doesn’t have write permissions set in its file attributes? Is there a way to