lua-users home
lua-l archive

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


I added an execvp, which looks like execvp(prog, ...) so its easier to wrap in a lua function such as:

function myexec(file, ...)
         pid = assert(ox.fork())
        if (pid == 0) then -- Child
                ox.execvp(file, arg)
                -- We never get here
        else
                ox.wait(pid)
        end
        return pid
end

I added waitpid which acts just like waitpid in c, and allows you to specify the type of wait you want to do in the second argument like:
cpid, retval, signo = ox.waitpid(pid, ox.WNOHANG)

This allows you to get more information, such as if the process was killed by a signal etc.

and I added nanosleep which allows you to sleep in smaller increments then a second IE:
ox.nanosleep(.005)

Would this be of interest to anyone?  My error handling of waitpid needs some cleanup I think though.

Mike

On 10/16/06, Natanael Copa <natanael.copa@gmail.com> wrote:
Oi!

On Mon, 2006-10-16 at 14:37 -0400, Leo Razoumov wrote:
> George,
> I added your Pglob function to lposix.c and created corresponding test
> case in test.lua.

Thanks! I was looking for glos just the other day.

> Posix glob function takes bitwise ORed flags as its second argument.
> Since Lua bitwise operations are still a topic of active discussions I
> left your code as is. glob functions takes only one argument, the
> pattern (no flags, no error function).
>
> Below I attached modified tarball.

I am very interested in lposix and I would like it to be a standard
available package in all major linux/bsd distros.

Are all the t2 patches included too?
http://www.t2-project.org/packages/lua-posix.html

I'm intrested in adding crypt(3) (to generate passwords), chroot and a
wrapper to getopt. Where in the file can I add those? Are the funcs in
any particular order?

Would it be an idea to split them in several files, to be scaleable?

How can we help Luiz to get those in to next "official" release of
lposix?

Obrigado!

--
Natanael Copa