[REBOL] Re: using copy with serial ports under Win2000
From: holger:rebol at: 12-Jun-2001 8:54
On Mon, Jun 04, 2001 at 01:51:40PM +1000, Chris Wright wrote:
> I'm using a serial port under win2000
>
> ser: serial://9600/1/odd/7
Use
ser: open/direct/no-wait serial://9600/1/odd/7
> But if, instead of repeated "first ser" I try:
>
> print copy ser
>
> I timeout.
>
> I don't understand why.
This is because by default 'copy waits until end-of-file
before returning. Your serial port never creates an end-of-file
condition, so 'copy waits indefinitely. If you add the /no-wait
refinement to 'open 'copy does not block and instead returns
whatever data is available. You may still have to loop and wait
though, depending on how your protocol works.
--
Holger Kruse
[holger--rebol--com]