showSessions: function to list details for currently active REDUCE...

View source: R/redcas.R

showSessionsR Documentation

function to list details for currently active REDUCE sessions.

Description

For each active REDUCE session returns the full path to the REDUCE executable and the temporary log file, the connection identifier, the number of code blocks executed and the number of lines read from the log so far.

Usage

showSessions(id)

Arguments

id

The session id for which to display the details. May be omitted. If none specified, display details for all sessions. The session id is returned by redStart.

Value

A data frame with the following columns:

id

integer, the session identifier;

pcon

integer, the input connection for the REDUCE session;

cmd

character, full path to the REDUCE executable;

logname

character, full path to the log file;

blockn

integer, number of blocks of REDUCE code submitted, i.e. number of calls to any function which sends code to REDUCE, currently redExec, asltx and redSolve ;

lines.read

integer, number of lines read from the log file for the session.

Author(s)

martin gregory

See Also

redStart for creating a REDUCE session and redClose for closing a session.

Examples

## Open a PSL session:
id1 <- redStart('psl')
## can only run code if session was successfully started
if (is.numeric(id1)) {
   ## show session details:
   print(showSessions(id1))

   ## retrieve the entire transcript up to now
   writeLines(readLines(showSessions(id1)[,'logname'], warn=FALSE))

   ## close session:
   redClose(id1)
}

redcas documentation built on April 12, 2025, 1:40 a.m.