lua-users home
lua-l archive

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


My understanding is that cygwin and MSDev coexistence gets
more difficult as the MS version numbers get higher.

Some points to note:

 - I have had most of the functions you mention implmeneted for some
time. Let me know if you want code.
 -  errno() should call GetLastError() rather than use errno.
 - I would add to your list the following (I have them implemented),
  dir, exec, files, getpid, getppid, kill and unlink
 Note that the unlink direct equivalent is something like -

#ifdef _WIN32
static int l_unlink(lua_State  *L)
{
    const char* s = fixpath(L, 1);
        HANDLE h = CreateFile(s,GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE,
          (LPSECURITY_ATTRIBUTES)0,	// address of security descriptor
          OPEN_EXISTING,
          FILE_FLAG_DELETE_ON_CLOSE|FILE_ATTRIBUTE_NORMAL,
          (HANDLE)0);				 	   // handle of file with attributes to copy

        if (h!=INVALID_HANDLE_VALUE) {
          CloseHandle(h);
          lua_pushboolean(L,1);
          return 1;
        }
        return pusherrstr(L, GetLastError());
}

#else

This simulates the *nix unlink semantics.

- In luasocket Diego has a very good sleep implementation that
sounds similar to what you have done. Check it out.

-

On 1/15/06, Chris Marrin <chris@marrin.com> wrote:
>
> I have been trying to port lposix to compile and link under MSDev. ...