Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Reading from stdi - what am I doing wrong?!

From: chris:starforge at: 13-Jul-2001 20:45

On 13-Jul-01, Paul Tretter wrote:
> I would like to see more of the script. Anytime I ever use ports - I stay > away from read-io and write-io.
Sending the whole script would compromise my site security, but these two demonstrate the important parts: ------------ #!/path/to/rebol REBOL [] buffer: make string! 50000 read-io system/ports/input buffer 50000 write %robot.out buffer ------------- or ---------- #!/path/to/rebol REBOL [] write %robot.out copy system/ports/input ------------- The top version works fine, until I send a large email in which case only part of it is obtained. The second version works for any size email except that I end up with {To: [address--starforge--co--uk]}{from: [chris--starforge--co--uk]}{Date: .....}{body of the email} in buffer. I haven't tested the scripts with large mails locally, but I guess the problem with the read-io version is that it's not waiting for all the email to come in. The copy would work fine, if it gave me the email as one big strings with newlines intact... Chris -- New sig in the works Explorer2260, Designer and Coder -- A formal parsing algorithm should not always be used. -- D. Gries