RE: Input redirection in exw

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hi all,

i already mentioned this problem in the past. Excerpt from a previous mail (Nov.
2001)
---
"In the file bind.doc that comes with Euphoria 2.2 it is stated:
" A bound executable file can handle standard input and output redirection. e.g.

        myprog.exe < file.in > file.out"

This is simply not true, at least on NT/W2K platforms. The reason is the bound
executable starts in a new console window that is unaware of the invoking
window's environment."
---
As Derek noticed it works with the DOS32 interpreter but then you are restricted
to short filenames, i.e. 8.3 format. Try it.

BTW piping is also unusable. 

For those who wonder what piping is, it is something related to redirection (and
also originating from Unix) that allows the output from a program to be fed
directly into the input of another program. The piping symbol is "|". A classical
example of its use is: dir | sort which takes the output of dir and passes it to
the sort utility. Thus it's a kind of shorthand for the 2 lines:

dir > junk.txt
sort < junk.txt

and it spares you the third "housekeeping" line:

del junk.txt

All said this means that "dir" and "sort" cannot presently be written in
Euphoria. Sob, sob!

Henri Goffin

> -----Original Message-----
> From:	Derek Parnell [SMTP:ddparnell at bigpond.com]
> Sent:	Tuesday, March 05, 2002 12:37 AM
> To:	EUforum
> Subject:	Re: Input redirection in exw
> 
> 
> 5/03/2002 10:23:33 AM, Ray Smith <smithr at ix.net.au> wrote:
> 
> >
> >Hi,
> >
> >Just playing with input redirection and I can't get it to work with 
> >the windows interpreter (exw).
> >
> >Using ex I can type 
> >
> >ex program.ex < program_input.txt > program_output.txt 
> >
> >and everything works great.
> >
> >I do the same with exw and it just sits there waiting for me to type
> >the input.  ie. it doesn't read from "program_input.txt".
> >
> >Is there something stupid I'm doing?
> >
> >The contest rules (it had to come back to that!) state your 
> >program should (preferably) work on all platforms.
> >Since the contests requires input redirection I don't know how that 
> >would work under windows.
> >
> >Thanks,
> >
> >Ray Smith
> >http://rays-web.com
> >
> >
> ---------
> Cheers,
> Derek Parnell 
> ICQ# 7647806
> 
> I think you are right, Ray. Here is the test program I used:
> 
>  ---------------
>  object aline
>  procedure main()
>  aline = gets(0)
>  while sequence (aline) do
>     puts(1, aline)
>     aline = gets(0)
>  end while
>  end procedure
>  main()
>  ------------
> 
> when I ran it as "ex redirect <redirect.ex" I got the program text displayed
> on the screen as
> expected. But when I ran it as "exw redirect.ex <redirect.ex" I got a console
> window opened up that
> sat waiting for keyboard entry!. Also, the linefeed char was not returned by
> gets(0) in Windows
> environment, but is under DOS!
> ---------
> Derek
> 
> 
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu