Using NS3000/iX Network Services (36920-90008)

58 Chapter 3
Remote File Access
Example RFA Program
Example RFA Program
What follows is a Pascal program that writes some test data to a remote
file, reads the data back from the remote file, and sends the received
data to a remote printer to be printed. An environment has been
established on the remote node. Prior FILE commands have been
issued for the formal file designators representing the remote disk file
and remote printer. These file equations specify the remote location of
the files.
$standard_level 'hp3000'$
$uslinit$
{**********************************}
{Note: issue file equations such as}
{ :file remfile=remfile:rodan}
{ and}
( :file remprint;dev=rodan#lp}
{before running this program}
{**********************************}
program rfaprog(remfile,remprint,output);
type
teststring = packed array [1..72] of char;
smallint = -32768..32767;
var
remfile : text;
remprint : text;
i : integer;
test1 : teststring;
test2 : teststring;
begin {program rfaprog}
{open remote disc file}
writeln('Opening remote disc file');
rewrite (remfile);
{write test data to remote file}
test1: = 'Remote File Access test';
for i: = 1 to 9 do
writeln (remfile,test1);
{open remote line printer as devicefile}
writeln('Opening remote LP file');
reset (remfile);
{read each record from remote file, then print each record on remote printer}
rewrite (remprint);