Re: Questions regarding the sandbox in iOS
Re: Questions regarding the sandbox in iOS
- Subject: Re: Questions regarding the sandbox in iOS
- From: Carl Hoefs <email@hidden>
- Date: Tue, 05 Feb 2019 19:13:30 -0700
> On Feb 5, 2019, at 6:38 PM, Saagar Jha <email@hidden> wrote:
>
> FYI, iOS apps start with their working directory set to “/“ (but don’t depend
> on this!), so trying to write there is going to fail.
Yes, the writes to / do appear to fail.
> NSHomeDirectory is an easy way to get your sandbox root, but you should
> probably be using the options the others have mentioned.
Of NSHomeDirectory, NSDocumentDirectory, and NSLibraryDirectory, I'm currently
using NSDocumentLibrary for the scratch directory. I presume for each of these
areas, the storage is persistent across app invocations. Is there a temporary
area available for use?
-Carl
>
> Regards,
> Saagar Jha
>
>> On Feb 4, 2019, at 19:30, Carl Hoefs <email@hidden
>> <mailto:email@hidden>> wrote:
>>
>> iOS 12
>>
>> Q1. In general, is an iOS app expected to determine the sandbox path to
>> manage its files?
>>
>> Q2. Does the sandbox behave like the "current working directory" default on
>> macOS? (i.e., if a function writes out a file to just "filename" with no
>> path, does it get written automatically to the sandbox?)
>>
>> Q3. What is the proper way to determine the app sandbox path? Is there an
>> app-wide runtime global?
>>
>> NSString *sandbox =
>> [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES)
>> lastObject];
>>
>> -Carl
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden
>> <mailto: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
>> <http://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