[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: about lposix
- From: "Mike Panetta" <panetta.mike@...>
- Date: Tue, 17 Oct 2006 22:34:19 -0400
Very nice. :) That has improved my outlooks quite a bit then I think. You didn't comment on my point 2, but I assume that it goes with point 1.
I also thought of something else. I am not sure how it works in windows, but for POSIX systems there are some calls that combine the functionality of others. popen() is an example of this. We could do functions like that in pure lua by wrapping the posix lua functions close, dup, fork and exec. The function dup is itself a wrapper on fcntl, so we could just impliment that in the c portion of the library and create dup on top of that...
Are we going for speed, size, or ease of use? Maybe the answer is to create C code for the lowest level functions possible and write the actual API in lua. So on a windows system say, the lua popen (or whatever you wish to call it) would do all the things required to spawn a process with a pipe as stdin, and stdout, and on a POSIX system it would be a wrapper to the calls close, fcntl, fork and exec... How does that sound? It would definately make me happy, because if for some reason the higher level API did not do what I wanted to, I could still use the lower level one. It may not be the fastest solution (execution wise) but it is definately the most flexible one.
Mike
On 10/17/06, David Burgess <dburgess@gmail.com> wrote:
Mike Panetta wrote:
> The only thing I can do I tell you what I absolutly need the library to
> support... Will this platform independant library give me these things?
>
> 1. The ability to fork and exec arbitrary processes off and wait (without
> blocking!) for them to finish executing, and give me an exit status from
> said process. (Getting the exit status from the process is VERY important in
> my application)
I have Lua windows code that does this.
>
> 3. File/Directory manipulation.
Can be made to match. (luafs however is not the answer).
For the time being, assume that implementation will do this well.
>
> 4. IO Pipes between processes. I routinely wrap unix utilities to redirect
> their output to an LCD (after some formatting) to tell the user whats
> happening on the system (IE fsck completion info)
I have Lua windows code that does this.
- References:
- about lposix, Luiz Henrique de Figueiredo
- Re: about lposix, Ralph Hempel
- Re: about lposix, Mike Panetta
- Re: about lposix, Ralph Hempel
- Re: about lposix, Mike Panetta
- Re: about lposix, Ralph Hempel
- Re: about lposix, Natanael Copa
- Re: about lposix, Doug Currie
- Re: about lposix, Mike Panetta
- Re: about lposix, David Burgess