lua-users home
lua-l archive

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


Martin Spernau wrote:
Hi!

Hi!

as we noted some time ago, the LuaCheia code has had this functionality. The code is still there, but currently not used (as it is pending to be made into a module) http://cvs.sourceforge.net/viewcvs.py/luacheia/luacheia/src/libcheia/cheiafs.c?rev=1.17&view=auto

I spotted a minor bug in the code above:

#define LC_ISPATHSEP(C) (C=="/" ? 1 : 0 )
                         ^^^^^^
should probably be C=='/' or strcmp( C, "/" )!=0

And the same for
#define LC_ISPATHSEP(C) (C!="\\" ? (C=="/" ? 1 : 0 ) : 1)
                         ^^^^^^^    ^^^^^^
#define LC_ISPATHSEP(C) (C==":" ? 1 : 0 )
                         ^^^^^^


The Win32 'emulation' is in these files:
http://cvs.sourceforge.net/viewcvs.py/luacheia/luacheia/src/libcheia/dirent.c?rev=1.2&view=auto http://cvs.sourceforge.net/viewcvs.py/luacheia/luacheia/src/libcheia/dirent.h?rev=1.2&view=auto

This works ok on Linux and Win32, I'm not sure if OSX was tested...

The code does need some work to be really usefull, but maybe some finds it usefull already.

If there is interest and maybe some additional platforms contributed, I'd love to do a proper Lua-module from it.

cheers, Martin


Philipp