Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mdeh

macrumors 6502
Original poster
Jan 3, 2009
345
2
A rather dumb but hopefully easy question.

Does the OS keep a TemporaryDirectory at all times.

So the call;

tempDir = NSTemporaryDirecory;

simply returns an existing Directory?


Once the programmer is done with this, does it have to be deleted?

Thanks
 

larkost

macrumors 6502a
Oct 13, 2007
534
1
A quick look at the documentation indicates that this returns the user temporary items folder in /private/var/tmp/folders. This does not get erased on reboot, and is available to all processes running as that user. So you should create a directory inside that (or in /tmp if you want it to go away even if you crash) and then remove it at the end of your run.
 

mdeh

macrumors 6502
Original poster
Jan 3, 2009
345
2
A quick look at the documentation indicates that this returns the user temporary items folder in /private/var/tmp/folders. This does not get erased on reboot, and is available to all processes running as that user. So you should create a directory inside that (or in /tmp if you want it to go away even if you crash) and then remove it at the end of your run.


Thanks larkost.

When you say "a quick look at the documentation", where exactly did you look. The documentation to a newbie can be pretty daunting.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.