$large itemize: do; /* * This program copies each pathname given by the input filespec * to the corresponding output file. It is intended to be used * with a single output file and a wild-card input pathname, in * which case it places in that output file all pathnames matching * the input filespec. * * by Albert J. Goodman; Edit date: 30-July-1985 */ /* Get the needed iRMX 86 system call external declarations */ $include(:I:NEXCEP.LIT) $include(:I:LTKSEL.LIT) $include(:I:IEXIOJ.EXT) $include(:I:NSTEXH.EXT) $include(:I:HGTIPN.EXT) $include(:I:HGTOPN.EXT) $include(:I:HGTOCN.EXT) $include(:I:ISWRMV.EXT) $include(:I:ISCLOS.EXT) $include(:I:ISDLCN.EXT) declare CR literally '0Dh', /* ASCII Carriage-return character */ LF literally '0Ah', /* ASCII Line-feed character */ ( input$pathname, output$pathname ) structure( len byte, ch(80) byte), output$preposition byte, output$connection token, ( bytes$written, status ) word, exception$handler$info structure( offset word, base word, mode byte); check$excep: procedure; /* Check for an exception code */ if ( status <> E$OK ) then /* we got an exceptional condition */ call rq$exit$io$job( status, 0, @status ); /* abort the program */ end check$excep; /* begin ITEMIZE */ /* Disable our exception handler, so control never passes to it. */ exception$handler$info.offset = 0; exception$handler$info.base = 0; exception$handler$info.mode = 0; call rq$set$exception$handler( @exception$handler$info, @status ); call check$excep; /* get the first input pathname */ call rq$c$get$input$pathname( @input$pathname, size( input$pathname ), @status ); call check$excep; /* while we have any more pathnames */ do while ( input$pathname.len > 0 ); /* Get the matching output pathname (default to command output) */ output$preposition = rq$c$get$output$pathname( @output$pathname, size( output$pathname ), @( 7,'TO :CO:' ), @status ); call check$excep; /* Get a connection to the output file */ output$connection = rq$c$get$output$connection( @output$pathname, output$preposition, @status ); call check$excep; /* Copy the input pathname to the output file */ bytes$written = rq$s$write$move( output$connection, @input$pathname.ch, input$pathname.len, @status ); call check$excep; /* Append a carriage-return/line-feed line terminator */ bytes$written = rq$s$write$move( output$connection, @( CR,LF ), 2, @status ); call check$excep; /* Close the output file */ call rq$s$close( output$connection, @status ); call check$excep; /* And delete the output connection */ call rq$s$delete$connection( output$connection, @status ); call check$excep; /* Get the next input pathname, if any */ call rq$c$get$input$pathname( @input$pathname, size( input$pathname ), @status ); call check$excep; end; /* do while ( input$pathname.len > 0 ) */ /* Terminate the program, signalling O.K. */ call rq$exit$io$job( E$OK, 0, @status ); end itemize;