delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/21/03:40:27

Date: Tue, 21 Jan 1997 10:20:58 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Adrian Oboroc <ash AT cinf DOT usm DOT md>
cc: djgpp AT delorie DOT com
Subject: Re: About redirection...
In-Reply-To: <Pine.LNX.3.93.970121093239.6000K-100000@cinf.usm.md>
Message-ID: <Pine.SUN.3.91.970121101302.26269e-100000@is>
MIME-Version: 1.0

On Tue, 21 Jan 1997, Adrian Oboroc wrote:

> Sorry men, but I think using redir isn't too comfortable

Please explain what isn't too comfortable with `redir'.

Btw, the DJGPP FAQ list suggests alternative methods for capturing screen 
output (see section 6.12 of the FAQ).  Did you try any of them?

> A) pre-check command line parameters, and pass to main program only
> part before ">", ">&" and "<" combinations
> B) perform the redirection of output from stdout (and stderr for ">&")
> to a file, mentioned after ">" or ">&" operation.
> C) check for "<" sign and redirect file after this symbol to stdin.

This won't work.  The < and > characters are special to COMMAND.COM, it
attempts to parse them when it sees them on the command line and will most
probably be totally confused when it sees >& or some such, and not invoke
the program at all.  In any way, these characters are NOT passed to the
program, so our startup code doesn't even see them. 

> thinking about this topic? At least it will be more natural, then
> "someprog.exe /? > info.txt" to get short instructions in text file

That actually works, at least with programs whose design is consistent.  
For example, all GNU utilities print their short help screens to stdout, 
so you can redirect as above.  If any programs compiled with DJGPP don't, 
then this is something you should complain to the author(s) of those 
programs.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019