OSI/TS Configuration and Management Manual

Programming Examples
OSI/TS Configuration and Management Manual424831-001
C-5
TAL Example File-Transfer Program, Responder
INT .buffer := %100000; !I/O buffer
?NOLIST, source $system.system.extdecs(open,control,read,
? write,close,create,setmodenowait,fnameexpand,
? purge,awaitio)
?LIST
?page
! ******************************************************
! * STARTUP - to read the startup message in $RECEIVE
! ******************************************************
PROC startup;
BEGIN
!
! define local variables;
!
STRUCT startup^msg;
BEGIN
INT msgcode;
STRUCT default;
BEGIN
INT vol[0:3];
INT subvol[0:3];
END;
STRUCT infile;
BEGIN
INT vol[0:3];
INT subvol[0:3];
INT name[0:3];
END;
STRUCT outfile;
BEGIN
INT vol[0:3];
INT subvol[0:3];
INT name[0:3];
END;
STRUCT parameter;
BEGIN
STRING bytes[0:40];
END;
END;
INT receive^name[0:11] := ["$RECEIVE", 8 * [" "]];
INT rcv^num;
INT count^read;
CALL open(receive^name, rcv^num);
CALL read(rcv^num, startup^msg, $LEN(startup^msg),
count^read);
CALL close(rcv^num);
END;
?page
! ******************************************************
! *