|
From: Ben A. <be...@bg...> - 2002-09-27 18:05:41
|
On Fri, 2002-09-27 at 14:21, Block, Kenneth wrote:
> This is interesting. It works fine from C, but not Basic.
Just confirmed that with an equivalent C++ test program. Yeah, you're
right.
> I wonder if the magic to make sys$input equal stdin is inside the CRTL
> I wonder if it works for Pascal or Fortran? Could somebody test Pascal
> and Fortran, it has been quite some time since I used either and do
> not have the compilers handy.
Sounds likely. I no longer have a license to Fortran or Pascal, but
running xmodem.exe (source is xmodem.for) I get:
bash$ echo "receive foo.bar" | run dyulib:xmodem
XMODEM Version 5.73 3/ 9/93 [BATCH capable]
$_Command: receive foo.bar
unsupported options ignored
Receiving File: FOO.BAR
Please Send Your File --
I had to enter "receive foo.bar" by hand at the prompt. So input
redirection doesn't work here either.
By contrast, running the equivalent from DCL:
$ pipe write sys$output "receive foo.bar" | run dyulib:xmodem
XMODEM Version 5.73 3/ 9/93 [BATCH capable]
unsupported options ignored
%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual
address=0000000000000008, PC=FFFFFFFF88C077B4, PS=0000001B
etc.
So, XMODEM happily munches the "receive foo.bar" command (otherwise it
would have tried to prompt me for the command) and the ACCVIO is thrown
when xmodem hits the end of the input stream.
Finally, CRUDETYPE.EXE (source, CRUDETYPE.PAS):
bash$ crudetype <<EOD
> a
> b
> c
> d
> e
> f
> g
> h
> EOD
a
b
c
d
Fatal: Could not open DVI file!
But in DCL:
$ run crudetype
a
b
c
d
Fatal: Could not open DVI file!
In other words, normally crudetype munches the first four records of
input (the DVI header) before giving up. In bash, I gave 8 lines of
input thru stdin, which crudetype ignored. Then after my EOD, I gave
crudetype four lines of input directly from sys$input.
So the only working stdin so far is my C++ test program. All others
fail, supporting the hypothesis that there is some magic in the CRTL
that makes stdin equivalent to sys$input.
Ben
--
Ben Armstrong -. Medianet Development Group,
BAr...@dy... `-. Dymaxion Research Limited
<URL: http://www.dymaxion.ca/> `- Halifax, Nova Scotia, Canada
|