[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: use a string as stdin?
- From: Valerio Schiavoni <valerio.schiavoni@...>
- Date: Tue, 23 Mar 2010 09:51:19 +0100
On Tue, Mar 23, 2010 at 8:52 AM, steve donovan
<steve.j.donovan@gmail.com> wrote:
> On Tue, Mar 23, 2010 at 9:44 AM, Valerio Schiavoni
> <valerio.schiavoni@gmail.com> wrote:
>> Do you know if it's possible to play with stdin so that the string is
>> set as the current stdin, so that I avoid to write on disk ?
>
> Unfortunately, we do not have popen2, where you can write to the
> process input and then read the process output. (I believe luaex has
> such a function)
what is luaex ?
>
> Using a temp file isn't so bad, but make sure it's writeable for
> everyone.
what i do is:
local tmpFileName =
tmpFile = io.open(tmpFileName,"w")
tmpFile:write(s)
tmpFile:close()
which i expect to be safe.