Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8641681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:35:22+00:00 2026-06-12T11:35:22+00:00

I have a C library I’m modifying, as little as possible, to add a

  • 0

I have a C library I’m modifying, as little as possible, to add a feature and get that to run properly on iOS. It is working fine on iOS 5.1, but breaking on iOS 6 because it’s required to write a small temporary file, and I think there is an issue w/ Entitlements with where it used to write (/tmp/some.file).

I know that NSHomeDirectory() will give me the sandbox root from objectiveC, but it requires objectiveC / Foundation to run. How can I get the sandbox root using only C / CoreFoundation calls?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:35:23+00:00Added an answer on June 12, 2026 at 11:35 am

    The CoreFoundation equivalent of NSHomeDirectory() is CFCopyHomeDirectoryURL(). It is available since iOS 5 and the only place where it is “documented” is in the iOS 4.3 to iOS 5.0 API Differences.

    If you want the temporary directory without hardcoding the tmp string, then you may want to use confstr with the _CS_DARWIN_USER_TEMP_DIR constant and fallback to the TMPDIR environment variable if the confstr call fails:

    char tmpdir[PATH_MAX];
    size_t n = confstr(_CS_DARWIN_USER_TEMP_DIR, tmpdir, sizeof(tmpdir));
    if ((n <= 0) || (n >= sizeof(tmpdir)))
        strlcpy(tmpdir, getenv("TMPDIR"), sizeof(tmpdir));
    CFURLRef tmp = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (UInt8 *)tmpdir, strlen(tmpdir), true);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a library that I'm trying to get working with rails 3 (specifically
I have a library method Common.addTheUsualStuffToTheModel(model) that needs to add various attributes to the
I have a library with an Interface. Public Interface Progress { int ProgressValue{get;set;}, string
I have a library made in C++/GDI that I am trying to port to
I have a library project that should be the base for several web applications.
I have a library that interacts with our phone system, ie, Hey phone, call
I have a library written in C that I would like to use in
We have a Library Project that we use for all our central reused code
I have a library that does I/O. There are a couple of external knobs
I have library code that uses ICSharpCode.SharpZipLib under the hood to make it easy

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.