There is no home directory in iOS.
Your application is in the sandbox, so you do not have access to /tmp .
Instead, you have a tmp inside your application's sandbox.
You can use CFBundle to get the path to your application.
You can find the ../tmp/ folder by adding ../tmp/ .
Basically:
CFBundleRef bundle; CFURLRef url; CFStringRef bundlePath; CFStringRef tmpRelPath; CFMutableStringRef tmpPath; bundle = CFBundleGetMainBundle(); url = CFBundleCopyBundleURL( bundle ); bundlePath = CFURLCopyFileSystemPath( url, kCFURLPOSIXPathStyle ); tmpRelPath = CFSTR( "/../tmp/" ); tmpPath = CFStringCreateMutable( kCFAllocatorDefault, CFStringGetLength( bundlePath ) + CFStringGetLength( tmpRelPath ) ); CFStringAppend( tmpPath, bundlePath ); CFStringAppend( tmpPath, tmpRelPath ); CFShow( tmpPath ); CFRelease( url ); CFRelease( bundlePath ); CFRelease( tmpPath );
source share