lua-users home
lua-l archive

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



On Saturday, November 17, 2001, at 02:15  PM, Reuben Thomas wrote:
>>I agree, though it would be nice to have a standard directory add-on
>>that supported the most popular OSes(Windows, Mac, Unix).
Any energy people have in this direction should be directed at the
StandardLibraryProposal on the wiki! I'd be delighted if someone or
some people started on this. There's a lot that can be done completely
OS-independently, and much more that can be done taking a few
OS-specific considerations into account.

StandardLibraryProposal looks like all lua code. It's great to have something like that, but we still need bindings for OS stuff like directories.

Btw, I think it would be ideal if any work done in this direction isolate the OS abstraction APIs from the Lua binding. This way, any/all scripting languages could share the code.

For example, instead of:

static void luadirlib_directoryContentsAt(void)
{
  char *path = luaL_check_string(1);
  ...platform specific code...
  ...lua code to push results...
}

do:

static void luadirlib_directoryContentsAt(void)
{
  char *path = luaL_check_string(1);
  results = dirlib_directoryContentsAt(path)
  ...lua code to push results...
}

And make the dirlib a seperately compilable library from lua_dirlib.

Steve