Redirecting stdin (was Re: retokenize tables)

Kenneth Brody kenbrody at bestweb.net
Wed Jan 24 09:28:57 PST 2007


Quoting Jay R. Ashworth (Wed, 24 Jan 2007 00:47:40 -0500):
[...]
> you pipe the appropriate keystrokes into dcabe which (mirabile visu)
> *actually read STDIN*.
[...]

The Unix versions of filePro have always been able to redirect stdin
(as well as stdout and stderr), because that's the way Unix works.
You could even fake special keystrokes by forcing TERM to a fixed
value and putting the appropriate escape sequences in the stream to
be read by filePro.

Windows, on the other hand, simply doesn't work that way.  The console
API functions just don't work as expected if you are not really using
the console as I/O.

Normally, filePro uses "CONIN$" and "CONOUT$" for input/output, which
are not affected if stdio is redirected.  You can tell filePro to use
STD_INPUT_HANDLE and STD_OUTPUT_HANDLE (the Windows names for stdin
and stdout) by setting PFNEWNTCONSOLE=OFF.  filePro will continue to
work with this if you don't redirect stdio.  However, if you run like
this outside of a GI environment, and redirect stdio, filePro will
hang due to the console API calls failing.  (Specifically, the
PeekConsoleInput API call fails with an "invalid handle" error, as
the handle is not a console handle.  I'm pretty sure that the
ReadConsoleInput API call would fail the same way for the same
reason.)

--
KenBrody at BestWeb dot net        spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com


More information about the Filepro-list mailing list