Redirection

jdz at wucec2.UUCP jdz at wucec2.UUCP
Tue Mar 4 13:38:19 AEST 1986


In article <1403 at decwrl.DEC.COM> williams at dec-kirk.UUCP writes:
>
>For example, VMS has neither redirection nor pipelining. All this
>means is that you have to open a file.

Excuse me? VMS most certainly does have redirection. DCL does not support this
in its syntax as nicely as [bck]sh, but it does indeed do it. Note that the
name for stdin is SYS$INPUT and that stdout is SYS$OUTPUT. The DCL is
$ ASSIGN/USER_MODE "INFILE.DAT" SYS$INPUT
$ ASSIGN/USER_MODE "SAVEOUTPUT.DAT" SYS$OUTPUT
$ RUN PROG

The /USER_MODE option indicates that the redirections are for the execution of
one image only (i.e. just the next program executed).

>#include <stdio.h>
>FILE *infile,*outfile;
>
>infile = fopen("file.in","r");
>outfile = fopen("file.out","w");

But this defeats the entire purpose of i/o independence. Since VMS can do it
right, please do so.

>	Sure, those *features* are missed a little bit, but I certainly
>wouldn't call VMS half-assed. I simply takes a little more to get
>around that *particular* problem. As a matter of fact, most VMS
>tools don't bother with stdio at all, they use default filename
>extentions.

The only problem with VMS and redirection is that DCL doesn't support a nice
syntax for doing this in a command line. If you really want this, buy DECshell
for your system.

Pipes can be made to work using permanent mailboxes and redirecting i/o to
them; this may require some real code in the program, though. At least enough
code somewhere to create the mailboxes in the first place and to do the
appropriate redirection. It just might be able to be done in DCL, but the
ugliness is probably not worth it.
-- 
Jason D. Zions			...!{seismo,cbosgd,ihnp4}!wucs!wucec2!jdz
Box 1045 Washington University
St. Louis MO 63130  USA		(314) 889-6160
Nope, I didn't say nothing. Just random noise.



More information about the Comp.lang.c mailing list