A community of Frontier
and Radio Users


Meridian News


Community List


Regex Project

Re: traps.unix for Radio? (was Re: Calling Radio from CLI)

Posted 
Last Modified 
In Response To 
 
2/26/2002; 5:09 PM by Brent Simmons
2/26/2002; 5:09 PM by Brent Simmons
traps.unix for Radio? (was Re: Calling Radio from CLI) (#16213)
Reply To This Message [Edit]
traps.unix.scpt:

on scpt (scriptName, paramList) {
«Find the script and call it with the parameter list. It
works like XML-RPC and SOAP handlers. The root table is
user.unix.scripts. Addresses are dereferenced. Any #security scripts
found during the walk are run. All parameters are received as strings
-- so your scripts need to take that into account. Also, the result
from a command line call usually ends with "n" (a line feed) -- your
scripts will have to add those if appropriate.
«05/09/01; 12:22:46 AM by PBS

local (nomad, adrScript);
local (adrHandlers = @user.unix.scripts);
local (securityList = {});

bundle { //locate the script
try {
local (s = scriptName, name);
nomad = adrHandlers;
loop {
if typeOf (nomad^) == tabletype {
local (adr = @nomad^.["#security"]);
if defined (adr^) {
securitylist =
securitylist + {adr}}};
if sizeof (s) == 0 {
break};
name = string.nthField (s, '.', 1);
nomad = @nomad^.[name];
if typeof (nomad^) == addresstype {
nomad = nomad^};
s = string.delete (s, 1, sizeof (name) + 1)};
adrscript = nomad}
else {
scriptError ("Can't call " + scriptName + "
because the script wasn't found.")}};

bundle { //check in with the #security scripts
local (adr);
for adr in securitylist {
local (t);
t.scriptName = scriptName;
t.paramList = paramList;
callScript (string (adr), {}, @t)}};

local (t); //dummy paramtable
new (tableType, @t);
return (callScript (string (adrScript), paramList, @t))}
//call the script; return the response

-Brent

At 4:02 PM -0500 2/26/02, Jim Roepcke wrote:
>Read on the web at http://community.scriptmeridian.org/16213
>----------------------------------
>
>On Tuesday, February 26, 2002, at 09:59 AM, James Spahr wrote:
>
>> I did have to copy over traps.unix, & create a user.unix.scripts -- but
>> everything seems to run just fine.
>
>Brent,
>
>Could traps.unix please be made available to Radio users?
>
>Thx,
>
>Jim

Enclosures


None.  

Replies


None.