Re: About path to temporary items.
Re: About path to temporary items.
- Subject: Re: About path to temporary items.
- From: Shane Stanley <email@hidden>
- Date: Mon, 17 Oct 2016 11:10:22 +1100
On 17 Oct. 2016, at 10:08 am, Jim Underwood <email@hidden> wrote:
>
> By "the *true* temp folder", do you mean "/tmp" ?
No -- *true* was a poor choice of word. I didn't mean the standard Unix temp folder -- I meant the temp folder macOS uses. Using a fixed path for such things is regarded as a security risk, hence the use of paths like /private/var/folders/9d/n7rpchy88xlg3b008k8ydqlh0000gn/T/, where some of the components are randomized. (The security angle might well explain the change people are talking about.)
Cocoa has a function for retrieving this path -- NSTemporaryDirectory() -- and I believe it's always in the user domain. Using 'echo $TMPDIR' in Terminal returns the same thing.
use framework "Foundation"
current application's NSTemporaryDirectory() as text
AppleScript seems to be tacking on another component, TemporaryItems, presumably to reduce the risk of overwriting other apps' stuff.
Here's a more up-to-date article, although it too is a couple of years old (based on 10.9): <http://www.magnusviri.com/OS_X_Admin/what-is-var-folders.html>
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden