OSI/FTAM Programming Reference Manual

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Reference Manual528611-001
G-170
Example 2 in TAL—Moving a File Between Two
Remote Systems (in Wait Mode)
349 ! Description: The movefile program written in wait mode moves a !
350 ! file between two systems on an OSI network. This !
351 ! application initiates and manages the file transfer. !
352 ! !
353 ! Inputs: None !
354 ! !
355 ! Outputs: None !
356 ! !
357 !----------------------------------------------------------------------!
358
359 PROC movefile MAIN;
360
361 BEGIN
362
363 !------------------------------------------------------------------!
364 ! Get the process startup message and open the terminal for output.!
365 !------------------------------------------------------------------!
366
367 CALL MYTERM ( termname );
368 CALL OPEN ( termname, termnum );
369
370 CALL OPEN ( receive, fn );
371 IF <> THEN
372 BEGIN
373 tempbuf ':=' "$RECEIVE open error" -> @text_ptr;
374 text_len := @text_ptr - @tempbuf;
375 CALL WRITE ( termnum, outbuf, text_len );
376 CALL STOP;
377 END;
378
379 CALL READ ( fn, startup, $len(startup));
380 IF <> THEN
381 BEGIN
382 tempbuf ':=' "$RECEIVE read error" -> @text_ptr;
383 text_len := @text_ptr - @tempbuf;
384 CALL WRITE ( termnum, outbuf, text_len );
385 CALL STOP;
386 END;
387