lua-users home
lua-l archive

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


On Thu, May 28, 2009 at 1:33 AM, David Burgess <dburgess@gmail.com> wrote:
> Further, here is a minmal list of candidates for osex inclusion:
> basename(path)
> dirname(path)

These can be done efficiently enough in Lua

> files([path])
> getcwd()
> mkdir(path)
> chdir(path)
> rmdir(path)
> unlink(path)
> stat(path,[options])
> uname([string])
> utime(path,[mtime,atime])

lfs covers these nicely - I certainly consider 'lfs' as one of the
canonical must-have modules!

> access(path,[mode])

This is useful and could IMHO be part of lfs, especially since Windows
people need to know where they can't write!

> errno([n])
> pipe()
> dup(old,[new])
> spawn(path,[args])  -- posix spawn can be implemented on win
> wait([pid])
> kill(pid,[sig])
> sleep(seconds)
> getpid([options])

Good candidates.  A cross-platform means to iterate over processes
would be useful for sysadmins.

> setenv(name,value,[over])
> getenv([name])

We do have os.getenv already, unless I'm missing something.

> chmod(path,mode)
> chown(path,uid,gid)

Not sure what meaning these would have on Windows.

Ryan's point about luaex is well taken - it has a default habit of
putting things in standard tables, but otherwise it does what it does
nicely.

steve d.