issue with read_stream_to_codes/2 on windows

Jos De Roo <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <OF53147962.9A185B28-ONC1257C8E.003BE54A-C1257C8E.003E5E05@agfa.com>
Hi Jan,

Here is an issue with read_stream_to_codes/2 on windows:

D:\>echo hello | swipl -g "read_stream_to_codes(user_input, Codes), 
atom_codes(Atom, Codes), write(Atom)"
|:
ERROR: Prolog initialisation failed:
ERROR: read_util:read_stream_to_codes/2: I/O error in read on stream 
user_input (The handle is invalid.
)

Typing a ^Z after "hello" works:

D:\>echo hello^Z | swipl -g "read_stream_to_codes(user_input, Codes), 
atom_codes(Atom, Codes), write(Atom)"
hello

but this cannot be done for other cases like:

D:\>type hello.txt | swipl -g "read_stream_to_codes(user_input, Codes), 
atom_codes(Atom, Codes), write(Atom)"
|:
ERROR: Prolog initialisation failed:
ERROR: read_util:read_stream_to_codes/2: I/O error in read on stream 
user_input (The handle is invalid.
)

 
Kind Regards,

Jos De Roo | Agfa HealthCare
Senior Researcher | HE/Advanced Clinical Applications Research
T  +32 3444 7618 | F  +32 3 444 8211 | M  +32 494 56 03 95

http://www.agfahealthcare.com
http://blog.agfahealthcare.com
R.O.: Septestraat 27, B-2640 Mortsel, Belgium | RLE Antwerp | VAT BE 
0403.003.524 | IBAN Operational Account BE81363012356224 | IBAN Customer 
Account BE20375104592856 | ING Belgium NV, B-1000 Brussels
Click on link to read important disclaimer: 
http://www.agfahealthcare.com/maildisclaimer 
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.