lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I agree in part with Asko Kappi. 

I have implemented something similar to his suggestion for 
Win32. (I am currently iteratively coding a possible alternative
solution, I will post to the list if I get it to work). Except
I did not call it execute() because I also need the original 
execute functionality.


Issues:

1) os.execute() provides very different function support
on windows to popen().

2) popen() is documented by MS as being unsupported for GUI
processes. Console processes only.

3) A recent posting http://lua-users.org/lists/lua-l/2004-06/msg00692.html
provides an alternate popen() implementation which solves *some* of the
Win32 isssues.

4) I agree with lhf that popen() should not be in the std iolib,
however I would like to be able to *easily* and *dynamically*
add popen() functionality (note that popen that needs 
Lua iolib support). 

5) os.execute and popen() are two features of standalone Lua that
are most important to me. I would not like to see them removed
from the core distribution. Maybe the way clear of this is to
shift the posix functions and functions like remove, rename, clock()
etc to a separate library but make this library part of the std
Lua distribution (say this lib is called loslib). 
I personally have found it a pain that the posix functions are 
in a separate lib to the os functions. 

On 2004-08-03  Asko Kauppi wrote:

>
>Imho, popen() could actually be merged with os.execute(). Basically, 
>they both do the same thing but with a different twist.
>
>How about:
>
>	rc_int [,stdout_str [,stderr_str]]= os.execute( cmd_str [,catch_int] )
>