BridgeSubmit.mesa
Copyright Ó 1987 by Xerox Corporation. All rights reserved.
Christian Le Cocq June 23, 1987 1:43:34 pm PDT
A layer of sugar on top of the Bridge package to allow easy submission of remote tasks to a Unix machine.
DIRECTORY
IO USING [STREAM],
Rope USING [ROPE];
BridgeSubmit: CEDAR DEFINITIONS ~ BEGIN
ROPE: TYPE = Rope.ROPE;
TransferProc: TYPE = PROC [id, wDir: ROPE, s: IO.STREAM] RETURNS [msg: ROPE];
Register: PROC [id, cmd, wDir: ROPE, phase1, phase2: TransferProc] RETURNS [msg: ROPE];
id is a rope which names this instance of the submission. For DATools it will likely be the name of the top level cell of interest.
phase1[id, wDir, s] will be called when the stream s is available from Bridge for the key id. Then the phase1 proc should call something like BridgeFTPOps.StoreFile[s, "/usr/...", "///Users/...", logStream].
cmd is launched after completion of phase1 if no msg were reported.
phase2 will be called when cmd is finished. It should call BridgeFTPOps.RetrieveFile[s, ...]; wDir will be used to extend the local names in phase1 & phase2, because when the FS calls will be performed the relevant information will not be present in the process properties.
ExecuteUnixShell: PROC [unixCmd: ROPE] RETURNS [errmsg: ROPE];
Sends the command line unixCmd to the Unix machine. No "\n" allowed, use ";" as a separator. errmsg#NIL means there has been a communication problem (# than a failure of unixCmd).
END.