Re: Questions regarding the sandbox in iOS

2019-02-06 Thread Jens Alfke
> On Feb 5, 2019, at 6:13 PM, Carl Hoefs wrote: > > 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 temporar

Re: Questions regarding the sandbox in iOS

2019-02-05 Thread Carl Hoefs
> On Feb 5, 2019, at 6:38 PM, Saagar Jha 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

Re: Questions regarding the sandbox in iOS

2019-02-05 Thread Saagar Jha
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. NSHomeDirectory is an easy way to get your sandbox root, but you should probably be using the options the others have mentioned. Regards, Saagar Jha > On Feb 4, 2

Re: Questions regarding the sandbox in iOS

2019-02-05 Thread Quincey Morris
Actually, I believe this should be: chdir(docsSandbox.fileSystemRepresentation) even though that’s often going to end up being the same C-string in both cases. > On Feb 5, 2019, at 12:29 , Carl Hoefs wrote: > > Yes, chdir(docsSandbox.UTF8String) works perfectly! _

Re: Questions regarding the sandbox in iOS

2019-02-05 Thread Carl Hoefs
> On Feb 5, 2019, at 10:30 AM, Jens Alfke wrote: > >> On Feb 5, 2019, at 9:25 AM, Carl Hoefs > > wrote: >> >> The reason for the specific sandbox questions is that my iOS app needs to >> call 3rd-party functions, some of which create temp files "in place

Re: Questions regarding the sandbox in iOS

2019-02-05 Thread Alex Zavatone
I would start by reading Apple’s standard docs on this. https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html Http://developer.apple.com/app-sandboxing/ There are also ways to share files betwee

Re: Questions regarding the sandbox in iOS

2019-02-05 Thread Jens Alfke
> On Feb 5, 2019, at 9:25 AM, Carl Hoefs wrote: > > The reason for the specific sandbox questions is that my iOS app needs to > call 3rd-party functions, some of which create temp files "in place" - as if > they did an fopen("filename.ext","w"). Such temp files appear to be written > "nowher

Re: Questions regarding the sandbox in iOS

2019-02-05 Thread Carl Hoefs
The reason for the specific sandbox questions is that my iOS app needs to call 3rd-party functions, some of which create temp files "in place" - as if they did an fopen("filename.ext","w"). Such temp files appear to be written "nowhere"... I was hoping that the sandbox might work along the lin

Re: Questions regarding the sandbox in iOS

2019-02-05 Thread Alex Zavatone
The sandbox is within the current app. The app also has access to other shared folders like Music and so on. NSString *appLibraryFolder = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSString *appDocumentsFolder = [NSSearchPathForDire

Questions regarding the sandbox in iOS

2019-02-04 Thread Carl Hoefs
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