• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: which temp dir to use?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: which temp dir to use?


  • Subject: Re: which temp dir to use?
  • From: Richard Frith-Macdonald <email@hidden>
  • Date: Sat, 23 May 2009 12:26:06 +0100


On 23 May 2009, at 11:43, Nick Rogers wrote:

Hi,
NSTemporaryDirectory(), returns something like /var/temp/we/weOIDM +mck............
Whereas I want to store files at a place with a fixed path.


So where should I save temp files? and how can I get that path programatically everytime?

What you want is user specific and application specific I presume (ie you want to store the data your your application, and for the person who is running the application). I guess it's not really temporary (or you wouldn't need a fixed path), but is actually information you would like to keep around, but which is not essential for your application.


The place for that is the standard per-user application support directory, and you get that using the NSSearchPathForDirectoriesInDomains() function specifying the NSApplicationSupportDirectory and NSUserDomainMask

Given that directory, you can just append the name of your application and make a subdirectory to hold your files.
_______________________________________________


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


  • Follow-Ups:
    • Re: which temp dir to use?
      • From: Dave Keck <email@hidden>
References: 
 >which temp dir to use? (From: Nick Rogers <email@hidden>)

  • Prev by Date: Document Types
  • Next by Date: Re: Multithreaded debugging help (audio recording eg).
  • Previous by thread: Re: which temp dir to use?
  • Next by thread: Re: which temp dir to use?
  • Index(es):
    • Date
    • Thread