[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: pipe to a pubprocess, or tmpfile
- From: Martin Voigt <voigt.m@...>
- Date: Tue, 7 Sep 2010 09:32:56 +0200
I'm having similar problems and tried io.popen. Problem is, popen
doesn't give you the return value of the command you ran.
Unfortunately I need both, the stdout/ stderr handles and the return
value. As for now I had to go with os.execute(cmd.." >
"..tmp_file_name.." 2> "..tmp_file_name) and fiddle to get it also run
on windows xp (xp and files, what a pain..."file is used by another
process"). Are there any alternatives besides patching io.popen?
bw,
Martin
On 7 September 2010 08:17, steve donovan <steve.j.donovan@gmail.com> wrote:
> On Tue, Sep 7, 2010 at 8:13 AM, <pj@pjb.com.au> wrote:
>> I can't see how to get to os.execute's stdin; or if I open a
>> tmpfile with tmpfile() I get a filehandle but can't see how
>> to find the filename so I can later
>> os.execute('aplaymidi '..tmpfilename)
>
> How about io.popen() ? Does the handle creation for you....
>
>