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: ryanc:iesco-dms at: 13-Jul-2001 12:27

It is not working on my server, but try this anyways: std-in: "" until [ read-io system/ports/input std-in system/options/cgi/content-length (to-integer system/options/cgi/content-length) <= length? std-in ] crlf's might not work here, because they can alter length of std-in. binary might fix that. I seem to have another problem going on, so havent got that far. Chris wrote:
> 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 > http://www.starforge.co.uk > -- > 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. > > -- > To unsubscribe from this list, please send an email to > [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Ryan Cole Programmer Analyst www.iesco-dms.com 707-468-5400