Loading a Sculptor program from a server

The run time interpreters sagewc and srepwc can load a program from a remote server which is running one of the Sculptor server programs (kfserver | kfservnt).

The syntax is:

sagewc | srepwc :progname

The program to be executed is an object code file with a .g or .q extension.

Use sagewc to execute .g files ( no report logic) or srepwc to execute .q files (report logic included).

The full path of the program should not be included. Special local and master directories are used to store programs that can be downloaded to clients.

Note

To run a program on the server, use the exec on server_name command. See Executing a child task on a server.


Updating program files from a server

Although the master version of the program resides on the server, a copy is retained locally on the client machine.

This local copy is made the first time the program is run and thereafter updated when the master copy has a later time stamp. Whenever the client calls the program, Sculptor checks the timestamp of both files and only updates the client if the version on the server is more recent. This ensures that the local programs on the client are up to date, while eliminating any unnecessary copying of files from the server.

Sculptor provides a set of environment variables for defining source and destination directories on the client and server machine. These are:

SCMASTER

The master Sculptor directory on the server

SCLOCALBIN

The local directory for Sculptor program files (on the client)

SCMASTERBIN

The master directory for Sculptor program files (on the server)

These variables are all set on the client machine. See Environment variables.

Local program directory

If set on the client, SCLOCALBIN defines the local program directory. Use of this environment variable enables programs to be stored in a directory that is not in the Sculptor root ($SCULPTOR). If it is not set, the local directory is $SCULPTOR/app.

Before loading the program, Sculptor checks whether a newer version exists on the server. It looks in the server’s master program directory.


Master program directory

If set on the client, SCMASTERBIN defines the master program directory on the server. If it is not set but SCMASTER is set, then the master program directory is $SCMASTER/app. Either SCMASTERBIN or SCMASTER must be set.

If the program in the master program directory has a later timestamp than the version in the local program directory, or if the program does not yet exist in the local program directory, it is copied to the client before it is run. Any directories in the target path that do not currently exist are automatically created.


Updating parameter files from a server

The same logic is applied to terminal and printer parameter files as to program files.

If the name of a terminal or printer parameter file is preceded with a colon, Sculptor checks for a newer version of the file on the server. They are only copied to the client if the version on the server is more recent.

SCMASTER must be defined on the client machine. Otherwise it is not possible to update parameter files on the client.

Printer parameter files

If the printer file name specified in a run report command begins with a colon (e.g. “:winpm”), and SCMASTER is defined, the file in $SCULPTOR/print is updated from the file in $SCMASTER/print, provided that the latter file exists and has a later timestamp. If the target directory does not exist, it is automatically created.


Terminal parameter files

If the file name set by SCTERMW begins with a colon (e.g. “:mswin”) and SCMASTER is defined, the file in $SCULPTOR/term is updated from the file in $SCMASTER/term, provided that the latter file exists and has a later timestamp. If the target directory does not exist, it is automatically created.


RELATED TOPICS

Servers

Running Sculptor programs on a server