Re: using tell with proc. serial numb. in OS X
Re: using tell with proc. serial numb. in OS X
- Subject: Re: using tell with proc. serial numb. in OS X
- From: "Neal A. Crocker" <email@hidden>
- Date: Wed, 14 Nov 2001 19:56:01 -0800
Date: Wed, 14 Nov 2001 09:41:24 -0800
To: email@hidden,
email@hidden
From: John W Baxter <email@hidden>
Subject: Re: using tell with proc. serial numb. in OS X
At 2:18 -0800 11/14/2001, Neal A. Crocker wrote:
>Identifying which of the process running "widgetd" to send to would
>depend on the purpose for which events were being sent and which
>script was sending them.
The typical Unix-ish way is to store the pid as a digit string in a file in
an agreed place with an agreed name. These tend to be world-readable, but
that varies. And they sometimes contain more than the pid...I work with
one program which maintains the file (of child processes) as kill commands,
so that it can just be executed to kill everything.
Have a look in /var/run, which appears to be FreeBSD/Mac OS X's
"agreed place."
Ah... It occured to me that any process providing a, in some sense,
globally available service could leave its address (i.e. pid) in a
predetermined file that any interested client could read to determine
where to send appleevents. Being a unix novice, I didn't realize
that this is very commonly used technique in Unix. Thanks for the
education, and hopefully the desire to provide this capability to
applescripters will inspire the Applescript Engineering team to add a
feature appelescript whereby appleevents could be directed to
processes by pid. (Possibly, they are way ahead of me on this....)
Presumably, a special case of widgetd would store its pid in a file with a
special agreed name, and would have found out it was special by the way it
was invoked.
--John