Re: [code] [textadept] Problem with spawn in macOS

From: Giovanni Salmeri <g.salmeri.att.mondodomani.org>
Date: Tue, 7 Nov 2017 08:56:24 +0100

> I suspect that `pandoc -v` is returning/exitting too quickly for
> spawn to read any resulting output from. For non-async commands that
> you expect to return nearly immediately, stick to Lua's `io.popen()`.
> In your `ls` example above, there is some I/O done before printing,
> and that "lag" is probably sufficient enough to allow spawn to do
> some reading.

The same thing happens also when pandoc (for example) has a file as
input [print(spawn('pandoc some_text.md'):read('a'))]... But anyway your
advice can solve my issue (I had almost forgotten io.popen ()!), I
think I will write my function using spawn for WIN32 (in order to avoid
the horrible flashing of the terminal), and io.popen for OSX and LINUX.
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 Tue 07 Nov 2017 - 02:56:24 EST

This archive was generated by hypermail 2.2.0 : Tue 07 Nov 2017 - 06:44:36 EST