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

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

From: chris:starforge at: 13-Jul-2001 19:41

Hi, As you'll know if you've seen /zine #2, I am building an email robot. I have an address on my domain which pipes emails to a rebol "robot". The naive method for reading stdin in the current version is: buffer: make string! 15000 read-io system/ports/input buffer 15000 This is fine for small emails, but if I send something with an attachment - say 40k - I need to up the buffer size. Still doesn't work though - read-io only seems to pick up the first 6 or so k before stopping. If I do buffer: copy system/ports/input I get the full email.. except that buffer is a block where each line is a separate string! - I could join it all together inserting newlines after every block but with bit emails that would be /slow/. Can anyone suggest how I can read from stdin to a buffer so that the whole thing is one string and I'm sure to get the whole message in the buffer, I'm completely stuck on this one... Chris -- New sig in the works Explorer2260, Designer and Coder -- Things I'd Do If I Ever Became An Evil Overlord 39. If I absolutely must ride into battle, I will certainly not ride at the forefront of my Legions of Terror, nor will I seek out my opposite number among his army.