Re: About path to temporary items.
Re: About path to temporary items.
- Subject: Re: About path to temporary items.
- From: Deivy Petrescu <email@hidden>
- Date: Mon, 17 Oct 2016 16:48:19 -0400
> On Oct 17, 2016, at 16:39 , Yvan KOENIG <email@hidden> wrote:
>
>
>> Le 17 oct. 2016 à 02:10, Shane Stanley <email@hidden> a écrit :
>>
>> 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>
>
>
> They don't return the same paths.
>
> use AppleScript version "2.4"
> use framework "Foundation"
> use scripting additions
> set PosixTemp to current application's NSTemporaryDirectory() as text
> --> "/var/folders/v2/40_tdtj114gbn1fw4xts8hzh0000gn/T/"
> set PosixTemp2 to POSIX path of (path to temporary items from user domain)
> --> "/private/var/folders/v2/40_tdtj114gbn1fw4xts8hzh0000gn/T/TemporaryItems/"
>
> As you may see, the first one doesn't include the "TemporaryItems" folder.
>
>
>
> Yvan KOENIG running Sierra 10.12.0 in French (VALLAURIS, France) lundi 17 octobre 2016 22:37:48
>
Yvan,
run this:
{path to “vtmp”,path to “temp”, path to “utmp”}
utmp is the path that Shane is talking about.
The one you mention is vtmp
Deivy Petrescu
email@hidden
_______________________________________________
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