[code] [textadept] Strange behaviour in spawn_proc:write(…)

From: Giovanni Salmeri <g.salmeri.att.mondodomani.org>
Date: Mon, 5 Oct 2015 10:31:28 +0200

Hello everybody.

I'm writing a function for Textadept which makes use of spawn and I'm
observing a strange behaviour. In the following snippet

proc = spawn(...)
local text = buffer:get_text()
proc:write(text)
proc:close()

only the first 64K of text (i.e. exactly 65536 bytes) are actually
written in the stdin of proc: all the rest seems to be discarded, with
no error message. But if I add a little pause after the spawning of the
process, for example like this:

proc = spawn(...)
local text = buffer:get_text()
local ntime = os.time() + 1
repeat until os.time() > ntime
proc:write(text)
proc:close()

all the text is regularly written (I discovered that by chance). I have
no problem in keeping this workaround, but I suspect I am doing
something wrong. Can someone help me? Thank you!

-- 
Giovanni Salmeri
http://mondodomani.org/pers/salmeri/
-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 05 Oct 2015 - 04:31:28 EDT

This archive was generated by hypermail 2.2.0 : Mon 05 Oct 2015 - 06:25:08 EDT